2026-07-17 23:20:34 +02:00
|
|
|
import { useT } from "../i18n";
|
|
|
|
|
import { useTheme } from "../lib/theme";
|
|
|
|
|
|
|
|
|
|
// Quick light/dark flip (the full light/dark/system selector lives in Settings).
|
|
|
|
|
export function ThemeToggle() {
|
|
|
|
|
const t = useT();
|
|
|
|
|
const { resolved, setTheme } = useTheme();
|
|
|
|
|
return (
|
|
|
|
|
<button
|
2026-08-06 19:23:27 +02:00
|
|
|
className="inline-flex h-7 w-7 items-center justify-center rounded text-app-muted hover:bg-app-hover hover:text-app-fg"
|
2026-07-17 23:20:34 +02:00
|
|
|
title={t("theme.toggle")}
|
|
|
|
|
aria-label={t("theme.toggle")}
|
|
|
|
|
onClick={() => setTheme(resolved === "dark" ? "light" : "dark")}
|
|
|
|
|
>
|
|
|
|
|
{resolved === "dark" ? "☀" : "☾"}
|
|
|
|
|
</button>
|
|
|
|
|
);
|
|
|
|
|
}
|