// ThemeToggle — flips the `.dark` class on . Persists choice // to the `voltro:theme` cookie so the server can bake the correct // class on the next request (and `themeBootScript` can sync the // initial paint without round-tripping localStorage). // // Component is interactive — when used inside a static page, mark // the surrounding island as `interaction` strategy. import { useEffect, useState, type HTMLAttributes, type ReactNode } from 'react' import { Button } from '../primitives/button' import { cn } from '../cn' import { THEME_COOKIE, setCookie } from '../cookies' /** * Inline script to drop into . Reads the `voltro:theme` cookie * (set by ThemeToggle / ProfileMenu) BEFORE React hydrates so the * initial paint matches — no FOUC even when the server hasn't yet * baked the cookie-derived class. * *