"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.usePopoverAnimation = void 0;
const react_1 = require("react");
/**
 * Хук для поповера с отложенным закрытием после окончания анимации
 */
const usePopoverAnimation = (isOpen) => {
    const [shouldRender, setShouldRender] = (0, react_1.useState)(isOpen);
    (0, react_1.useEffect)(() => {
        if (isOpen) {
            setShouldRender(true);
        }
    }, [isOpen]);
    const handleAnimationEnd = () => {
        if (!isOpen) {
            setShouldRender(false);
        }
    };
    return { shouldRender, handleAnimationEnd };
};
exports.usePopoverAnimation = usePopoverAnimation;
