import type { RulesEdition } from "@initiative/domain"; import { Monitor, Moon, Sun } from "lucide-react"; import { useRulesEditionContext } from "../contexts/rules-edition-context.js"; import { useThemeContext } from "../contexts/theme-context.js"; import { cn } from "../lib/utils.js"; import { Dialog, DialogHeader } from "./ui/dialog.js"; interface SettingsModalProps { open: boolean; onClose: () => void; } const EDITION_OPTIONS: { value: RulesEdition; label: string }[] = [ { value: "5e", label: "5e (2014)" }, { value: "5.5e", label: "5.5e (2024)" }, ]; const THEME_OPTIONS: { value: "system" | "light" | "dark"; label: string; icon: typeof Sun; }[] = [ { value: "system", label: "System", icon: Monitor }, { value: "light", label: "Light", icon: Sun }, { value: "dark", label: "Dark", icon: Moon }, ]; export function SettingsModal({ open, onClose }: Readonly) { const { edition, setEdition } = useRulesEditionContext(); const { preference, setPreference } = useThemeContext(); return (
Rules Edition
{EDITION_OPTIONS.map((opt) => ( ))}
Theme
{THEME_OPTIONS.map((opt) => { const Icon = opt.icon; return ( ); })}
); }