Files
ipal-kit/dist/modules/consent/ConsentContext.js
T
2026-08-03 12:24:28 +02:00

24 lines
695 B
JavaScript

'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