Files
Hayden Bleasel 44ae73eaaf Documentation (#219)
* Initial migration

* Update homepage

* Delete .source

* Fix gitignores

* Draft content

* Finish drafting content, migrate FAQ

* Update code-blocks.tsx

* Update route.ts

* Update next config

* Upgrade to Next.js 16, fix commands

* Update layout.tsx
2025-11-15 19:41:00 -08:00

21 lines
535 B
TypeScript

"use client";
import { MoonIcon, SunIcon } from "lucide-react";
import { useTheme } from "next-themes";
import { Button } from "../ui/button";
export const ThemeToggle = () => {
const { resolvedTheme, setTheme } = useTheme();
const Icon = resolvedTheme === "dark" ? MoonIcon : SunIcon;
const handleClick = () => {
setTheme(resolvedTheme === "dark" ? "light" : "dark");
};
return (
<Button onClick={handleClick} size="icon-sm" type="button" variant="ghost">
<Icon className="size-4" />
</Button>
);
};