mirror of
https://github.com/block/buzz.git
synced 2026-11-07 01:41:06 +00:00
62 lines
1.6 KiB
TypeScript
62 lines
1.6 KiB
TypeScript
import type { AgentTeam } from "@/shared/api/types";
|
|
import {
|
|
AlertDialog,
|
|
AlertDialogAction,
|
|
AlertDialogCancel,
|
|
AlertDialogContent,
|
|
AlertDialogDescription,
|
|
AlertDialogFooter,
|
|
AlertDialogHeader,
|
|
AlertDialogTitle,
|
|
} from "@/shared/ui/alert-dialog";
|
|
import { Button } from "@/shared/ui/button";
|
|
|
|
type TeamDeleteDialogProps = {
|
|
open: boolean;
|
|
team: AgentTeam | null;
|
|
onConfirm: (team: AgentTeam) => void;
|
|
onOpenChange: (open: boolean) => void;
|
|
};
|
|
|
|
export function TeamDeleteDialog({
|
|
open,
|
|
team,
|
|
onConfirm,
|
|
onOpenChange,
|
|
}: TeamDeleteDialogProps) {
|
|
return (
|
|
<AlertDialog onOpenChange={onOpenChange} open={open}>
|
|
<AlertDialogContent>
|
|
<AlertDialogHeader>
|
|
<AlertDialogTitle>Delete team?</AlertDialogTitle>
|
|
<AlertDialogDescription>
|
|
{team
|
|
? `Delete "${team.name}". Already-deployed agents are not affected, but this team template will no longer be available.`
|
|
: "Delete this team."}
|
|
</AlertDialogDescription>
|
|
</AlertDialogHeader>
|
|
<AlertDialogFooter>
|
|
<AlertDialogCancel asChild>
|
|
<Button type="button" variant="outline">
|
|
Cancel
|
|
</Button>
|
|
</AlertDialogCancel>
|
|
<AlertDialogAction asChild>
|
|
<Button
|
|
onClick={() => {
|
|
if (team) {
|
|
onConfirm(team);
|
|
}
|
|
}}
|
|
type="button"
|
|
variant="destructive"
|
|
>
|
|
Delete
|
|
</Button>
|
|
</AlertDialogAction>
|
|
</AlertDialogFooter>
|
|
</AlertDialogContent>
|
|
</AlertDialog>
|
|
);
|
|
}
|