import React, { createContext, useContext } from "react"; export interface AppTheme { accent: "cyan" | "blue"; success: "green"; warning: "yellow"; error: "red"; text: "white"; muted: "gray"; } const DEFAULT_THEME: AppTheme = { accent: "cyan", success: "green", warning: "yellow", error: "red", text: "white", muted: "gray" }; const ThemeContext = createContext(DEFAULT_THEME); export function ThemeProvider(props: { theme?: Partial; children: React.ReactNode }): JSX.Element { const value: AppTheme = { ...DEFAULT_THEME, ...(props.theme || {}) }; return {props.children}; } export function useTheme(): AppTheme { return useContext(ThemeContext); }