diff --git a/src/components/mode-toggle.tsx b/src/components/mode-toggle.tsx index 8ec4491..e025ee3 100644 --- a/src/components/mode-toggle.tsx +++ b/src/components/mode-toggle.tsx @@ -1,38 +1,60 @@ import { MonitorIcon, MoonIcon, SunIcon } from "lucide-react"; -import { useTheme } from "@/components/theme-provider"; import { Button } from "@/components/ui/button"; import { DropdownMenu, DropdownMenuContent, - DropdownMenuItem, + DropdownMenuRadioGroup, + DropdownMenuRadioItem, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; +import { type UserTheme, useTheme } from "./theme-provider"; -export function ModeToggle() { - const { setTheme } = useTheme(); +type ThemeToggleProps = { + getTheme?: () => UserTheme; +}; + +function ThemeIcon({ theme }: { theme: UserTheme }) { + const iconClass = "h-[1.2rem] w-[1.2rem]"; + + if (theme === "system") { + return ; + } + if (theme === "dark") { + return ; + } + return ; +} + +export function ModeToggle({ getTheme }: ThemeToggleProps) { + const { setTheme, userTheme } = useTheme(); + const theme = getTheme ? getTheme() : userTheme; return ( - setTheme("light")}> - - Light - - setTheme("dark")}> - - Dark - - setTheme("system")}> - - System - + setTheme(value as UserTheme)} + > + + + Light + + + + Dark + + + + System + + );