"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useLogic = void 0;
const react_1 = require("react");
const DashboardSidebarProvider_1 = require("../../../DashboardSidebarProvider");
const usePopoverAnimation_1 = require("../../../usePopoverAnimation");
const useLogic = ({ isOpen }) => {
    const { popoverAnchorRef } = (0, react_1.useContext)(DashboardSidebarProvider_1.DashboardSidebarContext);
    const topPosition = popoverAnchorRef.current?.offsetTop;
    const { shouldRender, handleAnimationEnd } = (0, usePopoverAnimation_1.usePopoverAnimation)(isOpen);
    return { handleAnimationEnd, shouldRender, topPosition };
};
exports.useLogic = useLogic;
