diff --git a/modules/core/src/web/hooks/use-unsaved-changes-notifier/components/form-commit-button-group.tsx b/modules/core/src/web/hooks/use-unsaved-changes-notifier/components/form-commit-button-group.tsx index b72f40e3..a82ea18d 100644 --- a/modules/core/src/web/hooks/use-unsaved-changes-notifier/components/form-commit-button-group.tsx +++ b/modules/core/src/web/hooks/use-unsaved-changes-notifier/components/form-commit-button-group.tsx @@ -2,6 +2,7 @@ import { Button, DropdownMenu, DropdownMenuContent, + DropdownMenuGroup, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, @@ -75,12 +76,10 @@ export const UpdateCommitButtonGroup = ({ // ⛳️ RHF opcional: auto-detectar isSubmitting si no se pasó isLoading let rhfIsSubmitting = false; - try { - const ctx = useFormContext(); - rhfIsSubmitting = !!ctx?.formState?.isSubmitting; - } catch { - // No hay provider de RHF; ignorar - } + + const ctx = useFormContext(); + rhfIsSubmitting = !!ctx?.formState?.isSubmitting; + const busy = isLoading ?? rhfIsSubmitting; const computedDisabled = !!(disabled || (preventDoubleSubmit && busy)); @@ -100,53 +99,57 @@ export const UpdateCommitButtonGroup = ({ {/* Menú de acciones adicionales */} {hasSecondaryActions && ( - - - + + + Más acciones + + } + /> - {onReset && ( - - - Deshacer cambios - - )} - {onPreview && ( - - - Vista previa - - )} - {onDuplicate && ( - - - Duplicar - - )} - {onBack && ( - - - Volver - - )} - {onDelete && ( - <> - + + {onReset && ( - - Eliminar + + Deshacer cambios - - )} + )} + {onPreview && ( + + + Vista previa + + )} + {onDuplicate && ( + + + Duplicar + + )} + {onBack && ( + + + Volver + + )} + {onDelete && ( + <> + + + + Eliminar + + + )} + )}