20 lines
635 B
TypeScript
20 lines
635 B
TypeScript
'use client'
|
|
|
|
import { deleteOrganization } from '../../actions'
|
|
|
|
export function DeleteOrgButton({ id, name }: { id: string; name: string }) {
|
|
async function handleDelete() {
|
|
if (!confirm(`Innung "${name}" wirklich unwiderruflich löschen? Alle Daten (Mitglieder, News, Termine, Stellen) werden gelöscht.`)) return
|
|
await deleteOrganization(id)
|
|
}
|
|
|
|
return (
|
|
<button
|
|
onClick={handleDelete}
|
|
className="w-full mt-2 px-4 py-2 bg-red-600 text-white text-sm font-medium rounded-lg hover:bg-red-700 transition-colors"
|
|
>
|
|
Innung löschen
|
|
</button>
|
|
)
|
|
}
|