"use client" import { Button } from "@/components/ui/button" import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu" import { cn } from "@/lib/utils" import { CheckCircleIcon } from "@heroicons/react/20/solid" import { Moon, Sun } from "lucide-react" import { useTranslations } from "next-intl" import { useTheme } from "next-themes" export function ModeToggle() { const { setTheme, theme } = useTheme() const t = useTranslations("ThemeSwitcher") const handleSelect = (e: Event, newTheme: string) => { e.preventDefault() setTheme(newTheme) } return ( handleSelect(e, "light")} > {t("Light")} {theme === "light" && } handleSelect(e, "dark")} > {t("Dark")} {theme === "dark" && } handleSelect(e, "system")} > {t("System")} {theme === "system" && } ) }