import React, { FC } from "react";
import DashboardHomeIntro from "./DashboardHomeIntro";
import DashboardFormInit from "./DashboardFormInit";
import DashboardHomeDetail from "./home/DashboardHomeDetail";
import DashboardHomeEmploymentInfo from "./home/DashboardHomeEmploymentInfo";
import DashboardHomeRefereeInfo from "./home/DashboardHomeRefereeInfo";
import DashboardHomeAttestation from "./home/DashboardHomeAttestation";

interface DashboardHomeProps {}

const DashboardHome: FC<DashboardHomeProps> = () => {
  const [step, setStep] = React.useState(1);

  const handleNextStep = () => {
    if (step < 7) {
      setStep(step + 1);
    }
  };

  return (
    <div className="w-full">
      {step === 1 && <DashboardHomeIntro step={step} handleNextStep={handleNextStep} />}
      {step === 2 && <DashboardFormInit handleNextStep={handleNextStep} />}
      {step === 3 && <DashboardHomeDetail handleNextStep={handleNextStep} />}
      {step === 4 && <DashboardHomeEmploymentInfo handleNextStep={handleNextStep} />}
      {step === 5 && <DashboardHomeRefereeInfo handleNextStep={handleNextStep} />}
      {step === 6 && <DashboardHomeAttestation handleNextStep={handleNextStep} />}
      {step === 7 && <DashboardHomeIntro step={step} handleNextStep={handleNextStep} />}
    </div>
  );
};

export default DashboardHome;
