web/app/theme-toggle.tsxblame
View source
135dfe51"use client";
135dfe52
135dfe53import { useTheme } from "@/lib/theme";
135dfe54
135dfe55export function ThemeToggle() {
135dfe56 const { theme, toggle } = useTheme();
135dfe57
135dfe58 return (
135dfe59 <button
135dfe510 onClick={toggle}
bf5fc3311 className="btn-reset p-1.5 hover-row"
bf5fc3312 style={{ color: "var(--text-muted)" }}
135dfe513 aria-label={`Switch to ${theme === "light" ? "dark" : "light"} mode`}
135dfe514 >
135dfe515 {theme === "light" ? (
135dfe516 <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
135dfe517 <path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" />
135dfe518 </svg>
135dfe519 ) : (
135dfe520 <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
135dfe521 <circle cx="12" cy="12" r="5" />
135dfe522 <line x1="12" y1="1" x2="12" y2="3" />
135dfe523 <line x1="12" y1="21" x2="12" y2="23" />
135dfe524 <line x1="4.22" y1="4.22" x2="5.64" y2="5.64" />
135dfe525 <line x1="18.36" y1="18.36" x2="19.78" y2="19.78" />
135dfe526 <line x1="1" y1="12" x2="3" y2="12" />
135dfe527 <line x1="21" y1="12" x2="23" y2="12" />
135dfe528 <line x1="4.22" y1="19.78" x2="5.64" y2="18.36" />
135dfe529 <line x1="18.36" y1="5.64" x2="19.78" y2="4.22" />
135dfe530 </svg>
135dfe531 )}
135dfe532 </button>
135dfe533 );
135dfe534}