import { jsx as _jsx } from "react/jsx-runtime";
import { useCallback, useMemo, useState } from 'react';
import { CardActionContext } from '../CardActionContext';
export const CardActionContextProvider = ({ children, isDisabledCard, onActionClick, }) => {
    const [isDisabled, setDisabled] = useState(false);
    const setDisabledActions = useCallback(() => {
        setDisabled(true);
    }, []);
    const removeDisabledActions = useCallback(() => {
        setDisabled(false);
    }, []);
    const contextValue = useMemo(() => ({
        isDisabled,
        isDisabledCard,
        setDisabledActions,
        removeDisabledActions,
        onActionClick,
    }), [
        isDisabled,
        setDisabledActions,
        removeDisabledActions,
        onActionClick,
        isDisabledCard,
    ]);
    return (_jsx(CardActionContext.Provider, { value: contextValue, children: children }));
};
