import { createContext, useContext } from 'react' export type Theme = 'system' | 'light' | 'dark' export interface ThemeContextValue { theme: Theme setTheme: (theme: Theme) => void resolvedDark: boolean } export const ThemeContext = createContext(null) export function useTheme(): ThemeContextValue { const context = useContext(ThemeContext) if (!context) { throw new Error('useTheme must be used within a ThemeProvider') } return context }