'use client' import * as React from 'react' import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from '@admin/components/ui/alert-dialog' import { Button } from '@admin/components/ui/button' import { Trash2 } from 'lucide-react' interface DeleteDialogProps { count: number entityName: string onConfirm: () => void isPending?: boolean } export function DeleteDialog({ count, entityName, onConfirm, isPending = false }: DeleteDialogProps) { const [open, setOpen] = React.useState(false) const label = count === 1 ? entityName : `${entityName}s` const targetLabel = count === 1 ? `this ${label}` : `these ${label}` return ( }> Delete {count} {label} Delete {count} {label}? This permanently deletes {targetLabel} and cannot be undone. Cancel { e.preventDefault() onConfirm() }} disabled={isPending} aria-busy={isPending} > {isPending ? 'Deleting…' : `Delete ${count} ${label}`} ) }