import { Moon, Sun } from "lucide-react"; import { useTranslation } from "react-i18next"; import { Button } from "@/components/ui/button"; import { DropdownMenu, DropdownMenuContent, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { useTheme } from "@/components/theme-provider"; export function ModeToggle() { const { theme, setTheme } = useTheme(); const { t } = useTranslation(); const handleChange = (value: string) => { if (value === "light" || value === "dark" || value === "system") { setTheme(value); } }; return ( {t("common.theme", { defaultValue: "主题" })} {t("common.lightMode", { defaultValue: "浅色" })} {t("common.darkMode", { defaultValue: "深色" })} {t("common.systemMode", { defaultValue: "跟随系统" })} ); }