import { Button } from "@/components/ui/button"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { cn } from "@/lib/utils"; import { Moon, Sun } from "lucide-react"; import { Theme } from "@/components/ThemeProvider"; import { useTheme } from "../hooks/use-theme"; import { CheckCircleIcon } from "@heroicons/react/20/solid"; import { useTranslation } from "react-i18next"; export function ModeToggle() { const { t } = useTranslation(); const { setTheme, theme } = useTheme(); const handleSelect = (e: Event, newTheme: Theme) => { e.preventDefault(); setTheme(newTheme); }; return ( handleSelect(e, "light")} > {t("theme.light")} {theme === "light" && } handleSelect(e, "dark")} > {t("theme.dark")} {theme === "dark" && } handleSelect(e, "system")} > {t("theme.system")} {theme === "system" && } ); }