import { useState } from 'react'; import { useRouteLoaderData } from 'react-router'; import type { loader as rootLoader } from '../../../root'; import { biergartenThemes, defaultThemeName, type ThemeName } from '../themes'; import ThemeSegmentedControl from './ThemeSegmentedControl'; const ThemeSwitcher = () => { const rootTheme = useRouteLoaderData('root')?.theme ?? defaultThemeName; const [selectedTheme, setSelectedTheme] = useState(rootTheme); const activeTheme = biergartenThemes.find((theme) => theme.value === selectedTheme) ?? biergartenThemes[0]; return ( <>

Theme Guide

Four themes, four moods — from the sun-bleached clarity of a Weizen afternoon to the deep berry dark of a Cassis barrel. Every theme shares the same semantic token structure so components stay consistent while the atmosphere shifts completely.

Active theme: {activeTheme.label} — {activeTheme.vibe}

Theme switcher

Pick a theme and preview it immediately.

); }; export default ThemeSwitcher;