From 1412e2dad581fefb151f1ae57dd02c43b823142d Mon Sep 17 00:00:00 2001 From: Rushabh528 Date: Sat, 12 Oct 2024 18:11:53 +0530 Subject: [PATCH 1/2] Applications recruited added --- components/Utils/IconMap.tsx | 1 + .../rc/[rcid]/proforma/[proformaid]/step5.tsx | 29 ++++++++++++++++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/components/Utils/IconMap.tsx b/components/Utils/IconMap.tsx index bc0a8362..d0517682 100644 --- a/components/Utils/IconMap.tsx +++ b/components/Utils/IconMap.tsx @@ -17,6 +17,7 @@ const iconMap: { [key: string]: React.ReactElement } = { "Aptitude Test": , "Technical Interview": , "HR Interview": , + Recruited: , Other: , }; diff --git a/pages/company/rc/[rcid]/proforma/[proformaid]/step5.tsx b/pages/company/rc/[rcid]/proforma/[proformaid]/step5.tsx index 4a083d52..62127f1e 100644 --- a/pages/company/rc/[rcid]/proforma/[proformaid]/step5.tsx +++ b/pages/company/rc/[rcid]/proforma/[proformaid]/step5.tsx @@ -1,3 +1,4 @@ +/* eslint-disable eqeqeq */ import AddIcon from "@mui/icons-material/Add"; import AddCircleOutlineIcon from "@mui/icons-material/AddCircleOutline"; import AttachFileIcon from "@mui/icons-material/AttachFile"; @@ -33,6 +34,7 @@ import Meta from "@components/Meta"; import eventRequest from "@callbacks/company/rc/proforma/event"; import useStore from "@store/store"; import { successNotification } from "@callbacks/notifcation"; +import { Key } from "react"; const ROUTE = "/company/rc/[rcid]/proforma/[proformaid]/step6"; @@ -67,6 +69,7 @@ function Step5() { control, name: "fieldArray", }); + useEffect(() => { const fetchStep4 = async () => { if (router.isReady) { @@ -96,11 +99,11 @@ function Step5() { }, [token, proformaid, rcid, router.isReady, reset]); const [activeStep, setActiveStep] = useState(0); const handleNext = () => { - setActiveStep((prevActiveStep) => prevActiveStep + 1); + setActiveStep((prevActiveStep: number) => prevActiveStep + 1); }; const handleBack = () => { - setActiveStep((prevActiveStep) => prevActiveStep - 1); + setActiveStep((prevActiveStep: number) => prevActiveStep - 1); }; const handleReset = () => { @@ -161,6 +164,13 @@ function Step5() { }; const handleAdd = (id: number) => { + if (fields.length == 0) { + append({ + label: "Applications", + duration: "0 min", + }); + setActiveStep(fields.length + 1); + } append({ label: tiles[id].label, duration: tiles[id].duration, @@ -276,7 +286,7 @@ function Step5() { - {fields.map((step, index) => ( + {fields.map((step: { ID: Key | null | undefined; }, index: number) => ( @@ -327,7 +337,18 @@ function Step5() {