.
This commit is contained in:
parent
911fdbb1c3
commit
77fec8fc77
@ -1,4 +1,3 @@
|
||||
import { SpainTaxCatalogProvider } from "@erp/core";
|
||||
import { ErrorAlert, NotFoundCard, PageHeader } from "@erp/core/components";
|
||||
import {
|
||||
FormCommitButtonGroup,
|
||||
@ -7,7 +6,6 @@ import {
|
||||
} from "@erp/core/hooks";
|
||||
import { SelectCustomerDialog } from "@erp/customers";
|
||||
import { AppContent, AppHeader, BackHistoryButton } from "@repo/rdx-ui/components";
|
||||
import { useMemo } from "react";
|
||||
import { FormProvider } from "react-hook-form";
|
||||
|
||||
import { useTranslation } from "../../../../i18n";
|
||||
@ -17,7 +15,6 @@ import { ProformaUpdateEditorForm } from "../editors";
|
||||
|
||||
export const ProformaUpdatePage = () => {
|
||||
const { t } = useTranslation();
|
||||
const taxCatalog = useMemo(() => SpainTaxCatalogProvider(), []);
|
||||
|
||||
const { updateCtrl, selectCustomerCtrl, returnTo } = useUpdateProformaPageController();
|
||||
|
||||
|
||||
@ -16,8 +16,9 @@ export const CustomerCreatePage = () => {
|
||||
const { form, formId, onSubmit, resetForm, isCreating, isCreateError, createError } = createCtrl;
|
||||
|
||||
return (
|
||||
<FormProvider {...form}>
|
||||
<UnsavedChangesProvider isDirty={form.formState.isDirty}>
|
||||
<AppHeader>
|
||||
<AppHeader className="mx-auto max-w-7xl space-y-4">
|
||||
<PageHeader
|
||||
description={t("pages.create.description")}
|
||||
onBackClick={() => navigate("/customers/list")}
|
||||
@ -38,7 +39,7 @@ export const CustomerCreatePage = () => {
|
||||
/>
|
||||
</AppHeader>
|
||||
|
||||
<AppContent>
|
||||
<AppContent className="mx-auto max-w-7xl space-y-4">
|
||||
{isCreateError && (
|
||||
<ErrorAlert
|
||||
message={(createError as Error)?.message ?? t("pages.create.errorMsg")}
|
||||
@ -46,14 +47,13 @@ export const CustomerCreatePage = () => {
|
||||
/>
|
||||
)}
|
||||
|
||||
<FormProvider {...form}>
|
||||
<CustomerCreateEditorForm
|
||||
className="bg-white rounded-xl border shadow-xl max-w-7xl mx-auto mt-6"
|
||||
formId={formId}
|
||||
onSubmit={onSubmit}
|
||||
/>
|
||||
</FormProvider>
|
||||
</AppContent>
|
||||
</UnsavedChangesProvider>
|
||||
</FormProvider>
|
||||
);
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user