import { useEffect } from 'react';
import { useToggleView } from '../../../store/builder/store'
import { useBuilderStore } from '../../../store/builder/useBuilderStore';
import FloorCreator from './floorCreator/floorCreator';
import FloorInstances from './Instances/floorInstances';
import useModuleStore from '../../../store/useModuleStore';

function FloorGroup() {
    const { togglView } = useToggleView();
    const { setSelectedFloor, setSelectedDecal } = useBuilderStore();
    const { activeModule } = useModuleStore();

    useEffect(() => {
        if (togglView || activeModule !== 'builder') {
            setSelectedFloor(null);
            setSelectedDecal(null);
        }
    }, [togglView, activeModule])

    return (
        <>

            <FloorCreator />

            <FloorInstances />

        </>
    )
}

export default FloorGroup