Add ThemeProvider

This commit is contained in:
Alex Gleason committed 2025-05-30 22:38:23 +02:00
1 parent e0d94fae71
commit a6eeb05d6e
6 files changed
+163 -11

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
import { createContext } from "react";
export type Theme = "dark" | "light" | "system";
export type ThemeProviderState = {
theme: Theme;
setTheme: (theme: Theme) => void;
};
const initialState: ThemeProviderState = {
theme: "system",
setTheme: () => null,
};
export const ThemeProviderContext = createContext<ThemeProviderState>(initialState);