import { useState } from "react";
import Hour from "./hour";
import Time from "./Time";
import PlaceVisit from "./PlaceVisit";

function Date({ doctor, setStep }) {
  const [locateVisit, setLocateVisit] = useState(true);
  const [isError, setIsError] = useState(false);

  return (
    <div className="w-full lg:w-[61%]">
      <div
        className="p-0 lg:p-[24px] rounded-[8px] border border-solid border-transparent lg:border-[#EFEFEF] 
            bg-transparent lg:bg-[#FFF]"
      >
        <PlaceVisit
          setLocateVisit={setLocateVisit}
          locateVisit={locateVisit}
          isError={isError}
        />
        <Time
          isStep={doctor.multiwork ? locateVisit : true}
          locateVisit={locateVisit}
        />
        <Hour
          isStep={doctor.multiwork ? locateVisit : true}
          setLocateVisit={setLocateVisit}
          locateVisit={locateVisit}
          setIsError={setIsError}
          setStep={setStep}
          doctor={doctor}
        />
      </div>
    </div>
  );
}

export default Date;
