"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CardActionContextProvider = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("react");
const CardActionContext_1 = require("../CardActionContext");
const CardActionContextProvider = ({ children, isDisabledCard, onActionClick, }) => {
    const [isDisabled, setDisabled] = (0, react_1.useState)(false);
    const setDisabledActions = (0, react_1.useCallback)(() => {
        setDisabled(true);
    }, []);
    const removeDisabledActions = (0, react_1.useCallback)(() => {
        setDisabled(false);
    }, []);
    const contextValue = (0, react_1.useMemo)(() => ({
        isDisabled,
        isDisabledCard,
        setDisabledActions,
        removeDisabledActions,
        onActionClick,
    }), [
        isDisabled,
        setDisabledActions,
        removeDisabledActions,
        onActionClick,
        isDisabledCard,
    ]);
    return ((0, jsx_runtime_1.jsx)(CardActionContext_1.CardActionContext.Provider, { value: contextValue, children: children }));
};
exports.CardActionContextProvider = CardActionContextProvider;
