mirror of
https://github.com/privacy-scaling-explorations/pse.dev.git
synced 2026-01-13 08:08:02 -05:00
24 lines
658 B
TypeScript
24 lines
658 B
TypeScript
"use client"
|
|
|
|
import * as React from "react"
|
|
import { useTheme } from "next-themes"
|
|
|
|
import { Button } from "@/components/ui/button"
|
|
import { Icons } from "@/components/icons"
|
|
|
|
export function ThemeToggle() {
|
|
const { setTheme, theme } = useTheme()
|
|
|
|
return (
|
|
<Button
|
|
variant="ghost"
|
|
size="sm"
|
|
onClick={() => setTheme(theme === "light" ? "dark" : "light")}
|
|
>
|
|
<Icons.sun className="rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
|
|
<Icons.moon className="absolute rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
|
|
<span className="sr-only">Toggle theme</span>
|
|
</Button>
|
|
)
|
|
}
|