From 31806455b4b4ba84149504c382a5f7f965415e1c Mon Sep 17 00:00:00 2001 From: rajun Date: Tue, 27 Oct 2026 16:28:48 +0530 Subject: [PATCH] feat: add dialog actions footer --- app/components/ui/dialog-actions.tsx | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 app/components/ui/dialog-actions.tsx diff --git a/app/components/ui/dialog-actions.tsx b/app/components/ui/dialog-actions.tsx new file mode 100644 index 0000000..3d64102 --- /dev/null +++ b/app/components/ui/dialog-actions.tsx @@ -0,0 +1,30 @@ +import { Loader2 } from 'lucide-react'; +import { Button, type ButtonProps } from '~/components/ui/button'; +import { DialogClose, DialogFooter } from '~/components/ui/dialog'; + +interface DialogActionsProps { + confirmLabel: string; + pendingLabel?: string; + cancelLabel?: string; + pending?: boolean; + disabled?: boolean; + variant?: ButtonProps['variant']; + onConfirm?: () => void; +} + +// Cancel + confirm footer; without `onConfirm` the confirm button submits the surrounding form +export function DialogActions({ confirmLabel, pendingLabel, cancelLabel = 'Cancel', pending, disabled, variant, onConfirm }: DialogActionsProps) { + return ( + + + + + + + ); +}