/
som_cooper
/
book-lib
Обзор
Документация
Войти
/
som_cooper
/
book-lib
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
admin/src/components/theme-context.js
17 строк
365 B
imdbcooper
Add unified admin search and theme system
23 май 2026, 14:28
23 май 2026, 14:28
9bd64bf
Код
Авторство
О чём код?
import { createContext, useContext } from 'react' export const ThemeProviderContext = createContext({ theme: 'system', resolvedTheme: 'light', setTheme: () => {}, }) export function useTheme() { const context = useContext(ThemeProviderContext) if (!context) { throw new Error('useTheme must be used within a ThemeProvider') } return context }