feat: deal group and stuff
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import BaseFormModal, {
|
||||
CreateEditFormProps,
|
||||
} from "../../ClientsPage/modals/BaseFormModal/BaseFormModal.tsx";
|
||||
import BaseFormModal, { CreateEditFormProps } from "../../ClientsPage/modals/BaseFormModal/BaseFormModal.tsx";
|
||||
import { DealSummary, ShippingWarehouseSchema } from "../../../client";
|
||||
import { ContextModalProps } from "@mantine/modals";
|
||||
import { useForm } from "@mantine/form";
|
||||
@@ -14,22 +12,24 @@ type RestProps = {
|
||||
};
|
||||
type Props = CreateEditFormProps<ShippingWarehouseSchema> & RestProps;
|
||||
const ShippingWarehouseForm = ({
|
||||
context,
|
||||
innerProps,
|
||||
id,
|
||||
}: ContextModalProps<Props>) => {
|
||||
context,
|
||||
innerProps,
|
||||
id,
|
||||
}: ContextModalProps<Props>) => {
|
||||
const isEditing = "onChange" in innerProps;
|
||||
|
||||
const form = useForm<ShippingWarehouseSchema>({
|
||||
initialValues: isEditing
|
||||
? innerProps.element
|
||||
: {
|
||||
id: -1,
|
||||
name: "",
|
||||
},
|
||||
id: -1,
|
||||
name: "",
|
||||
},
|
||||
});
|
||||
return (
|
||||
<DealPageContextProvider>
|
||||
<DealPageContextProvider refetchDeals={async () => {
|
||||
|
||||
}}>
|
||||
<BaseFormModal
|
||||
{...innerProps}
|
||||
closeOnSubmit
|
||||
|
||||
Reference in New Issue
Block a user