import { createContext, useContext, onMount } from 'solid-js'; import { createLicenseStore } from '../stores/license'; const LicenseContext = createContext(); export function LicenseProvider(props) { const store = createLicenseStore(); onMount(() => { store.refreshLicense(); }); return ( {props.children} ); } export function useLicense() { const context = useContext(LicenseContext); if (!context) { throw new Error('useLicense must be used within LicenseProvider'); } return context; }