Files
app-admin/app/apps/DeleteButton.tsx
2026-03-24 15:46:27 +03:00

29 lines
848 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";
interface Props {
appId: number;
appName: string;
deleteAction: (formData: FormData) => Promise<void>;
}
export default function DeleteButton({ appId, appName, deleteAction }: Props) {
return (
<form action={deleteAction}>
<input type="hidden" name="id" value={appId} />
<button
type="submit"
onClick={(e) => {
if (!confirm(`"${appName}" silinsin mi? Bu işlem geri alınamaz.`)) {
e.preventDefault();
}
}}
className="flex items-center gap-1.5 px-3 py-2 bg-red-50 dark:bg-red-900/10 text-red-500 border border-red-200 dark:border-red-900 rounded-xl text-xs font-bold hover:bg-red-100 dark:hover:bg-red-900/30 transition-colors"
>
<Trash2 size={13} /> Sil
</button>
</form>
);
}