mirror of
https://github.com/henrygd/beszel.git
synced 2025-12-17 10:46:16 +01:00
22 lines
677 B
Go
22 lines
677 B
Go
import { t } from "@lingui/core/macro"
|
|
import { MoonStarIcon, SunIcon } from "lucide-react"
|
|
|
|
import { Button } from "@/components/ui/button"
|
|
import { useTheme } from "@/components/theme-provider"
|
|
|
|
export function ModeToggle() {
|
|
const { theme, setTheme } = useTheme()
|
|
|
|
return (
|
|
<Button
|
|
variant={"ghost"}
|
|
size="icon"
|
|
aria-label={t`Toggle theme`}
|
|
onClick={() => setTheme(theme === "dark" ? "light" : "dark")}
|
|
>
|
|
<SunIcon className="h-[1.2rem] w-[1.2rem] transition-all -rotate-90 dark:opacity-0 dark:rotate-0" />
|
|
<MoonStarIcon className="absolute h-[1.2rem] w-[1.2rem] transition-all opacity-0 -rotate-90 dark:opacity-100 dark:rotate-0" />
|
|
</Button>
|
|
)
|
|
}
|