import { useEffect, useState } from "react"; import useStore from "../../../store/store"; import UnitList from "../../UnitList"; import LayoutSlider from "../../mobile/Appartment/LayoutSlider"; import { LayoutToggle } from "../../LayoutToggle"; import CrossButton from "../../CrossButton"; const LayoutModal = () => { const [currentView, setCurrentView] = useState(1); const [startIndex, setStartIndex] = useState(0); const { currentVilla, setModalAnimation } = useStore(); const [currentUnits, setCurrentUnits] = useState( currentVilla?.groundFloorUnits ); useEffect(() => { if (currentVilla) { switch (currentView) { case 3: setCurrentUnits(currentVilla.parkingUnits); setStartIndex(currentVilla.groundFloorUnits.length); break; case 2: setCurrentUnits(currentVilla.firstFloorUnits); setStartIndex(0); break; default: setCurrentUnits(currentVilla.groundFloorUnits); setStartIndex(0); break; } } }, [currentView, currentVilla]); const handleOnCloseClick = () => { setModalAnimation(1); }; return ( <>
{currentUnits && ( )}
); }; export default LayoutModal;