"use client"; import React from "react"; import { Laptop, Moon, Sun } from "lucide-react"; import { useTranslations } from "../i18n/provider"; import { useTheme, type ThemeChoice } from "../lib/theme"; /** Dark, light or follow the system: three buttons, one click each. */ export function ThemeToggle({ className = "" }: { className?: string }) { const t = useTranslations(); const theme = useTheme(); const options: [ThemeChoice, React.ComponentType<{ className?: string }>, string][] = [ ["dark", Moon, t("appearance.dark")], ["light", Sun, t("appearance.light")], ["system", Laptop, t("appearance.system")], ]; return (
{options.map(([value, Icon, label]) => ( ))}
); }