import type { ComponentType } from "preact"; import { theme, setTheme } from "../theme-state.ts"; import * as ui from "@exosphere/client/ui.css"; type IconComponent = ComponentType<{ size: string | number }>; interface ThemeToggleProps { icons: Record<"light" | "dark" | "system", IconComponent>; } const themeOptions = ["light", "dark", "system"] as const; const labels: Record<(typeof themeOptions)[number], string> = { light: "Light", dark: "Dark", system: "System", }; export function ThemeToggle({ icons }: ThemeToggleProps) { const current = theme.value; return (
{themeOptions.map((value) => { const Icon = icons[value]; return ( ); })}
); }