import React, { useContext } from "react";
import { FormContext } from "../../context/FormContext";
import FirstStepForm from "./FirstStepForm";
import SecondStepForm from "./SecondStepForm";

function Step() {
  const { activeStepIndex } = useContext(FormContext);
  let stepContent;
  switch (activeStepIndex) {
    case 0:
      stepContent = <FirstStepForm/>;
      break;
    case 1:
      stepContent = <SecondStepForm />;
      break;
    default:
      break;
  }

  return stepContent;
}

export default Step;
