import { useState } from 'react'; import { ConfirmModal } from '../ui/modal'; import { Checkbox } from '../ui/checkbox'; export interface DeleteStackDialogProps { open: boolean; onOpenChange: (open: boolean) => void; stackName: string | null; onConfirm: (pruneVolumes: boolean) => void | Promise; } export function DeleteStackDialog({ open, onOpenChange, stackName, onConfirm }: DeleteStackDialogProps) { const [pruneVolumes, setPruneVolumes] = useState(false); const handleOpenChange = (next: boolean) => { if (!next) setPruneVolumes(false); onOpenChange(next); }; return ( Delete {stackName}? ) : ( 'Delete stack?' ) } description={`Confirm deletion of ${stackName ?? 'stack'}.`} hint={pruneVolumes ? 'VOLUMES PRUNED' : 'VOLUMES KEPT'} confirmLabel="Delete" onConfirm={() => onConfirm(pruneVolumes)} >

This action cannot be undone.

setPruneVolumes(v === true)} />
); }