import { useState } from 'react';
import { useViewportType } from '../../useViewportType';
export const useLogic = () => {
    const [open, setOpen] = useState(false);
    const { isMobile } = useViewportType();
    const handleOpen = (e) => {
        e.stopPropagation();
        if (isMobile) {
            setOpen((prevState) => !prevState);
        }
    };
    const handleClose = (e) => {
        e.stopPropagation();
        if (isMobile) {
            setOpen(false);
        }
    };
    return {
        open,
        handleOpen,
        handleClose,
    };
};
