| 135dfe5 | | | 1 | "use client"; |
| 135dfe5 | | | 2 | |
| 135dfe5 | | | 3 | import { useTheme } from "@/lib/theme"; |
| 135dfe5 | | | 4 | |
| 135dfe5 | | | 5 | export function ThemeToggle() { |
| 135dfe5 | | | 6 | const { theme, toggle } = useTheme(); |
| 135dfe5 | | | 7 | |
| 135dfe5 | | | 8 | return ( |
| 135dfe5 | | | 9 | <button |
| 135dfe5 | | | 10 | onClick={toggle} |
| bf5fc33 | | | 11 | className="btn-reset p-1.5 hover-row" |
| bf5fc33 | | | 12 | style={{ color: "var(--text-muted)" }} |
| 135dfe5 | | | 13 | aria-label={`Switch to ${theme === "light" ? "dark" : "light"} mode`} |
| 135dfe5 | | | 14 | > |
| 135dfe5 | | | 15 | {theme === "light" ? ( |
| 135dfe5 | | | 16 | <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"> |
| 135dfe5 | | | 17 | <path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" /> |
| 135dfe5 | | | 18 | </svg> |
| 135dfe5 | | | 19 | ) : ( |
| 135dfe5 | | | 20 | <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"> |
| 135dfe5 | | | 21 | <circle cx="12" cy="12" r="5" /> |
| 135dfe5 | | | 22 | <line x1="12" y1="1" x2="12" y2="3" /> |
| 135dfe5 | | | 23 | <line x1="12" y1="21" x2="12" y2="23" /> |
| 135dfe5 | | | 24 | <line x1="4.22" y1="4.22" x2="5.64" y2="5.64" /> |
| 135dfe5 | | | 25 | <line x1="18.36" y1="18.36" x2="19.78" y2="19.78" /> |
| 135dfe5 | | | 26 | <line x1="1" y1="12" x2="3" y2="12" /> |
| 135dfe5 | | | 27 | <line x1="21" y1="12" x2="23" y2="12" /> |
| 135dfe5 | | | 28 | <line x1="4.22" y1="19.78" x2="5.64" y2="18.36" /> |
| 135dfe5 | | | 29 | <line x1="18.36" y1="5.64" x2="19.78" y2="4.22" /> |
| 135dfe5 | | | 30 | </svg> |
| 135dfe5 | | | 31 | )} |
| 135dfe5 | | | 32 | </button> |
| 135dfe5 | | | 33 | ); |
| 135dfe5 | | | 34 | } |