add dist
This commit is contained in:
+24
@@ -0,0 +1,24 @@
|
||||
'use client';
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
import { createContext, use } from 'react';
|
||||
import { useConsent } from './useConsent.js';
|
||||
const ConsentContext = /*#__PURE__*/ createContext(null);
|
||||
export function ConsentProvider({ children, texts }) {
|
||||
const consent = useConsent();
|
||||
return /*#__PURE__*/ _jsx(ConsentContext, {
|
||||
value: {
|
||||
...consent,
|
||||
texts
|
||||
},
|
||||
children: children
|
||||
});
|
||||
}
|
||||
export function useConsentContext() {
|
||||
const ctx = use(ConsentContext);
|
||||
if (!ctx) {
|
||||
throw new Error('useConsentContext must be used within ConsentProvider');
|
||||
}
|
||||
return ctx;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=ConsentContext.js.map
|
||||
Reference in New Issue
Block a user