Files
mtdb_movie/common/resources/client/ui/themes/theme-selector-context.ts
maher 703f50a09d
Some checks failed
Build / run (push) Has been cancelled
first commit
2025-10-29 11:42:25 +01:00

19 lines
453 B
TypeScript
Executable File

import {createContext, useContext} from 'react';
import {CssTheme} from './css-theme';
export type ThemeId = 'light' | 'dark' | number;
export interface ThemeSelectorContextValue {
allThemes: CssTheme[];
selectedTheme: CssTheme;
selectTheme: (themeId: ThemeId) => void;
}
export const ThemeSelectorContext = createContext<ThemeSelectorContextValue>(
null!
);
export function useThemeSelector() {
return useContext(ThemeSelectorContext);
}