diff --git a/frontend/src/app-components/buttons/FormButtons.tsx b/frontend/src/app-components/buttons/FormButtons.tsx index 181c9c51..4a86be72 100644 --- a/frontend/src/app-components/buttons/FormButtons.tsx +++ b/frontend/src/app-components/buttons/FormButtons.tsx @@ -1,34 +1,32 @@ /* - * Copyright © 2024 Hexastack. All rights reserved. + * Copyright © 2025 Hexastack. All rights reserved. * * Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms: * 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission. * 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file). */ + import CheckIcon from "@mui/icons-material/Check"; import CloseIcon from "@mui/icons-material/Close"; -import { Button } from "@mui/material"; +import { Button, Grid } from "@mui/material"; import { useTranslate } from "@/hooks/useTranslate"; import { FormButtonsProps } from "@/types/common/dialogs.types"; -export const FormButtons = ({ +export const DialogFormButtons = ({ onCancel, - onConfirm, + onSubmit, }: FormButtonsProps) => { const { t } = useTranslate(); return ( - <> - + - + + ); }; diff --git a/frontend/src/app-components/dialogs/FormDialog.tsx b/frontend/src/app-components/dialogs/FormDialog.tsx index c397420c..d2f22249 100644 --- a/frontend/src/app-components/dialogs/FormDialog.tsx +++ b/frontend/src/app-components/dialogs/FormDialog.tsx @@ -6,13 +6,12 @@ * 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file). */ - import { Dialog, DialogActions, DialogContent } from "@mui/material"; import { DialogTitle } from "@/app-components/dialogs"; import { FormDialogProps } from "@/types/common/dialogs.types"; -import { FormButtons } from "../buttons/FormButtons"; +import { DialogFormButtons } from "../buttons/FormButtons"; export const FormDialog = ({ title, @@ -26,10 +25,10 @@ export const FormDialog = ({ {title} {children} - - + rest.onClose?.({}, "backdropClick")} - onConfirm={onSubmit} + onSubmit={onSubmit} /> diff --git a/frontend/src/components/categories/CategoryForm.tsx b/frontend/src/components/categories/CategoryForm.tsx index 8e054abc..a2f17f69 100644 --- a/frontend/src/components/categories/CategoryForm.tsx +++ b/frontend/src/components/categories/CategoryForm.tsx @@ -85,9 +85,9 @@ export const CategoryForm: FC> = ({ return (
diff --git a/frontend/src/types/common/dialogs.types.ts b/frontend/src/types/common/dialogs.types.ts index 6548f8f8..5f2a13c8 100644 --- a/frontend/src/types/common/dialogs.types.ts +++ b/frontend/src/types/common/dialogs.types.ts @@ -154,7 +154,7 @@ export type ComponentFormProps = { export interface FormButtonsProps { onCancel?: () => void; - onConfirm: (e: BaseSyntheticEvent) => Promise; + onSubmit: (e: BaseSyntheticEvent) => Promise; } export type ComponentFormDialogProps = DialogProps;