import { jsx as _jsx } from "@emotion/react/jsx-runtime";
import { useBoolean } from "@chakra-ui/react";
import React from "react";
const context = React.createContext({
    refreshData: () => null,
    flag: false,
});
export const useRefreshDataContext = () => React.useContext(context);
const RefreshDataProvider = (props) => {
    const [flag, setFlag] = useBoolean();
    const refreshData = React.useCallback(() => setFlag.toggle(), []);
    const value = React.useMemo(() => ({ refreshData, flag }), [refreshData, flag]);
    return _jsx(context.Provider, Object.assign({ value: value }, { children: props.children }));
};
export default RefreshDataProvider;
//# sourceMappingURL=useRefreshData.js.map