import { useContext, useImperativeHandle } from 'react';
import { DashboardSidebarContext } from '../../DashboardSidebarProvider';
export const useLogic = ({ setIsPopupOpen, isPopupOpen, ref, }) => {
    const { popoverAnchorRef } = useContext(DashboardSidebarContext);
    useImperativeHandle(ref, () => popoverAnchorRef.current);
    const handleTogglePopover = () => {
        setIsPopupOpen(!isPopupOpen);
    };
    return { handleTogglePopover, popoverAnchorRef };
};
