"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useLogic = void 0;
const react_1 = require("react");
const DashboardSidebarProvider_1 = require("../../DashboardSidebarProvider");
const useLogic = ({ setIsPopupOpen, isPopupOpen, ref, }) => {
    const { popoverAnchorRef } = (0, react_1.useContext)(DashboardSidebarProvider_1.DashboardSidebarContext);
    (0, react_1.useImperativeHandle)(ref, () => popoverAnchorRef.current);
    const handleTogglePopover = () => {
        setIsPopupOpen(!isPopupOpen);
    };
    return { handleTogglePopover, popoverAnchorRef };
};
exports.useLogic = useLogic;
