feat: harden runtime readiness and session workflow
This commit is contained in:
@@ -3,18 +3,24 @@ import { Button } from "../components/ui/button";
|
||||
|
||||
interface Props {
|
||||
open: boolean;
|
||||
label: string;
|
||||
labels?: string[];
|
||||
/** Backward-compatible single-session label. */
|
||||
label?: string;
|
||||
onOpenChange: (open: boolean) => void;
|
||||
onConfirm: () => void;
|
||||
}
|
||||
|
||||
export function DeleteConfirmDialog({ open, label, onOpenChange, onConfirm }: Props) {
|
||||
export function DeleteConfirmDialog({ open, labels, label, onOpenChange, onConfirm }: Props) {
|
||||
const targets = labels ?? (label ? [label] : []);
|
||||
const description = targets.length > 1
|
||||
? `${targets.length} sessions will be permanently deleted, including all of their documents. This action cannot be undone.`
|
||||
: `"${targets[0]}" will be permanently deleted, including all of its documents. This action cannot be undone.`;
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogContent>
|
||||
<DialogHeader><DialogTitle>Delete permanently</DialogTitle></DialogHeader>
|
||||
<DialogDescription>
|
||||
"{label}" will be permanently deleted, including all of its documents. This action cannot be undone.
|
||||
{description}
|
||||
</DialogDescription>
|
||||
<DialogFooter>
|
||||
<Button type="button" variant="outline" size="sm" onClick={() => onOpenChange(false)}>Cancel</Button>
|
||||
|
||||
Reference in New Issue
Block a user