Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
23 lines
648 B
Plaintext
23 lines
648 B
Plaintext
import { jsx as _jsx } from "react/jsx-runtime";
|
|
import { createContext, use } from 'react';
|
|
export const ListDrawerContext = /*#__PURE__*/createContext({});
|
|
export const ListDrawerContextProvider = ({
|
|
children,
|
|
...rest
|
|
}) => {
|
|
return /*#__PURE__*/_jsx(ListDrawerContext, {
|
|
value: {
|
|
isInDrawer: Boolean(rest.drawerSlug),
|
|
...rest
|
|
},
|
|
children: children
|
|
});
|
|
};
|
|
export const useListDrawerContext = () => {
|
|
const context = use(ListDrawerContext);
|
|
if (!context) {
|
|
throw new Error('useListDrawerContext must be used within a ListDrawerContextProvider');
|
|
}
|
|
return context;
|
|
};
|
|
//# sourceMappingURL=Provider.js.map |