@replyke/core
Version:
Replyke: Build interactive apps with social features like comments, votes, feeds, user lists, notifications, and more.
15 lines • 576 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { createContext } from "react";
import useSpaceData from "../hooks/spaces/useSpaceData";
export const SpaceContext = createContext({});
export const SpaceProvider = ({ children, ...restOfProps }) => {
const data = useSpaceData(restOfProps);
if (!restOfProps.spaceId &&
!restOfProps.shortId &&
!restOfProps.slug &&
!restOfProps.space?.id) {
return null;
}
return _jsx(SpaceContext.Provider, { value: data, children: children });
};
//# sourceMappingURL=space-context.js.map