import { IconButton } from "@/components/xui/icon-button"; import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from "@/components/ui/alert-dialog" import { KeyedMutator } from "swr"; import { buttonVariants } from "@/components/ui/button" interface ButtonGroupProps { className?: string; children: React.ReactNode; delete: { fn: (id: number[]) => Promise, id: number, mutate: KeyedMutator }; } export function ActionButtonGroup({ className, children, delete: { fn, id, mutate } }: ButtonGroupProps) { const handleDelete = async () => { await fn([id]); await mutate(); } return (
{children} Confirm Deletion? This operation is unrecoverable! Cancel Confirm
) }