()
| 47 | const ThemeContext = createContext<ThemeContextValue | null>(null); |
| 48 | |
| 49 | export function useTheme(): ThemeContextValue { |
| 50 | const value = useContext(ThemeContext); |
| 51 | if (!value) { |
| 52 | throw new Error("useTheme must be used within a ThemeProvider"); |
| 53 | } |
| 54 | return value; |
| 55 | } |
| 56 | |
| 57 | type ThemeProviderProps = { |
| 58 | children: ReactNode; |
no outgoing calls
no test coverage detected