File tree Expand file tree Collapse file tree
frontend/src/shared/components/ui Expand file tree Collapse file tree Original file line number Diff line number Diff 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' }
You can’t perform that action at this time.
0 commit comments