change some files

This commit is contained in:
2026-06-02 17:08:52 +03:30
parent b8dc1d0e1b
commit cfb48c5bb0
76 changed files with 5204 additions and 2555 deletions

View File

@@ -0,0 +1,52 @@
// PhysicalInfoForm.tsx
"use client";
import React from "react";
import { withFormik, type FormikBag } from "formik";
import InnerPhysicalInfoForm from "./InnerPhysicalInfoForm";
import { PhysicalInfoFormValues } from "./types";
import { PHYSICAL_INFO_EMPTY_VALUES } from "./constants";
import { PhysicalInfoValidationSchema } from "./validation";
/** این بخش را با ساختار اصلی WizardFormData پروژه خودت هماهنگ کن */
export interface WizardFormData {
physicalInfo: PhysicalInfoFormValues;
// ... بقیه step ها
}
export type PhysicalInfoFormProps = {
step: number;
setStep: React.Dispatch<React.SetStateAction<number>>;
data: WizardFormData;
update: (patch: Partial<WizardFormData>) => void;
};
const PhysicalInfoForm = withFormik<
PhysicalInfoFormProps,
PhysicalInfoFormValues
>({
displayName: "PhysicalInfoForm",
enableReinitialize: true,
mapPropsToValues: (props) => {
return props.data?.physicalInfo ?? PHYSICAL_INFO_EMPTY_VALUES;
},
// validationSchema: PhysicalInfoValidationSchema,
handleSubmit: async (
values,
bag: FormikBag<PhysicalInfoFormProps, PhysicalInfoFormValues>,
) => {
const { props, setSubmitting } = bag;
props.update({ physicalInfo: values });
props.setStep((prev) => prev + 1);
setSubmitting(false);
},
})(InnerPhysicalInfoForm);
export default PhysicalInfoForm;