'use client';
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
import React, { createContext, use, useCallback } from 'react';
export const EntityVisibilityContext = /*#__PURE__*/ createContext({});
export const EntityVisibilityProvider = ({ children, visibleEntities })=>{
    const isEntityVisible = useCallback(({ collectionSlug, globalSlug })=>{
        if (collectionSlug) {
            return visibleEntities.collections.includes(collectionSlug);
        }
        if (globalSlug) {
            return visibleEntities.globals.includes(globalSlug);
        }
        return false;
    }, [
        visibleEntities
    ]);
    return /*#__PURE__*/ _jsxDEV(EntityVisibilityContext, {
        value: {
            isEntityVisible,
            visibleEntities
        },
        children: children
    }, void 0, false, {
        fileName: "src/providers/EntityVisibility/index.tsx",
        lineNumber: 45,
        columnNumber: 5
    }, this);
};
export const useEntityVisibility = ()=>use(EntityVisibilityContext);

//# sourceMappingURL=index.js.map