diff --git a/src/components/pages/production/recording/form/RecordingForm.tsx b/src/components/pages/production/recording/form/RecordingForm.tsx index 3520bc8e..f1543ab6 100644 --- a/src/components/pages/production/recording/form/RecordingForm.tsx +++ b/src/components/pages/production/recording/form/RecordingForm.tsx @@ -50,6 +50,7 @@ import { import { isResponseSuccess, isResponseError } from '@/lib/api-helper'; import { cn, formatDate } from '@/lib/helper'; import toast from 'react-hot-toast'; +import StepItem from '@/components/steps/StepItem'; interface RecordingFormProps { type?: 'add' | 'edit' | 'detail'; @@ -84,7 +85,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => { const [isApproveLoading, setIsApproveLoading] = useState(false); const [isRejectLoading, setIsRejectLoading] = useState(false); - const [, setFormSteps] = useState(null); + const [formSteps, setFormSteps] = useState(null); const [recordingFormErrorMessage, setRecordingFormErrorMessage] = useState(''); const [isDeleteLoading, setIsDeleteLoading] = useState(false); @@ -950,6 +951,26 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => { setIsRejectLoading(false); }; + useEffect(() => { + if (isLayingCategory) { + const steps: FormStepStatus[] = [ + { + name: 'Recording', + isCompleted: type === 'detail', + isCurrent: type !== 'detail', + }, + { + name: 'Grading', + isCompleted: false, + isCurrent: type === 'detail', + }, + ]; + setFormSteps(steps); + } else { + setFormSteps(null); + } + }, [isLayingCategory, type]); + // Body Weights Handlers const addBodyWeight = () => { const newBodyWeights = [ @@ -1290,6 +1311,63 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => { + {/* Project Flock Info Card */} + {(projectFlockKandangLookup || projectFlockKandangDetail) && ( +
+ {/* Form Steps for LAYING Category */} + {formSteps && ( +
+
+
    + {formSteps.map((step, idx) => ( + + ) : ( + idx + 1 + ) + } + > + {step.name} + + ))} +
+
+ + {/* Action buttons for multi-form navigation */} + {type === 'detail' && ( +
+ +
+ )} +
+ )} +
+ )} +