Skip to content

Commit f7598b6

Browse files
fix[frontend](broadcast): added hideCancel to confirm dialog form
1 parent 883449e commit f7598b6

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎frontend/src/shared/components/ui/confirm-dialog.tsx‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export interface ConfirmDialogProps {
1212
danger?: boolean
1313
icon?: LucideIcon
1414
busy?: boolean
15+
hideCancel?: boolean
1516
onClose: () => void
1617
onConfirm: () => void | Promise<void>
1718
}
@@ -25,6 +26,7 @@ export function ConfirmDialog({
2526
danger,
2627
icon: Icon = Trash2,
2728
busy: externalBusy,
29+
hideCancel,
2830
onClose,
2931
onConfirm,
3032
}: ConfirmDialogProps) {
@@ -72,9 +74,11 @@ export function ConfirmDialog({
7274
<div className="px-6 py-5 text-sm text-muted-foreground">{body}</div>
7375

7476
<footer className="flex items-center justify-end gap-2 border-t border-border px-6 py-3">
75-
<Button variant="outline" size="sm" onClick={onClose} disabled={busy}>
76-
{cancelLabel ?? t('common.actions.cancel')}
77-
</Button>
77+
{!hideCancel && (
78+
<Button variant="outline" size="sm" onClick={onClose} disabled={busy}>
79+
{cancelLabel ?? t('common.actions.cancel')}
80+
</Button>
81+
)}
7882
<Button
7983
size="sm"
8084
variant={danger ? 'destructive' : 'default'}

0 commit comments

Comments
 (0)