import { Monitor, Moon, Sun } from "lucide-react"; import { Button } from "@/components/ui/button"; import { cn } from "@/lib/utils"; import { useTranslation } from "react-i18next"; import { useTheme } from "@/components/theme-provider"; export function ThemeSettings() { const { t } = useTranslation(); const { theme, setTheme } = useTheme(); return (

{t("settings.theme")}

{t("settings.themeHint", { defaultValue: "选择应用的外观主题,立即生效。", })}

setTheme("light")} icon={Sun} > {t("settings.themeLight", { defaultValue: "浅色" })} setTheme("dark")} icon={Moon} > {t("settings.themeDark", { defaultValue: "深色" })} setTheme("system")} icon={Monitor} > {t("settings.themeSystem", { defaultValue: "跟随系统" })}
); } interface ThemeButtonProps { active: boolean; onClick: () => void; icon: React.ComponentType<{ className?: string }>; children: React.ReactNode; } function ThemeButton({ active, onClick, icon: Icon, children, }: ThemeButtonProps) { return ( ); }