Files
marmarislocal/components/DeleteButton.tsx
T

25 lines
642 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
'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>
)
}