mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 20:17:45 +00:00
18 lines
399 B
TypeScript
18 lines
399 B
TypeScript
import { createContext } from 'react';
|
|
|
|
export type Theme = 'dark' | 'light' | 'system';
|
|
|
|
export type ThemeProviderState = {
|
|
theme: Theme;
|
|
setTheme: (theme: Theme) => void;
|
|
isDark: boolean;
|
|
};
|
|
|
|
export const initialState: ThemeProviderState = {
|
|
theme: 'system',
|
|
setTheme: () => null,
|
|
isDark: false,
|
|
};
|
|
|
|
export const ThemeProviderContext = createContext<ThemeProviderState>(initialState);
|