'use client'

import { Trash2 } from 'lucide-react'
import { useFormStatus } from 'react-dom'

export default function DeleteButton() {
  const { pending } = useFormStatus()
  
  return (
    <button
      type="submit"
      disabled={pending}
      className="inline-flex items-center justify-center w-8 h-8 rounded-lg bg-stone hover:bg-red-50 text-shutter hover:text-red-500 transition-colors disabled:opacity-50"
      title="Sil"
      onClick={(e) => {
        if (!confirm('Bu kaydı silmek istediğinize emin misiniz?')) {
          e.preventDefault()
        }
      }}
    >
      <Trash2 className="w-4 h-4" />
    </button>
  )
}
