Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/llms-txt-hub / apps/web/components/mode-toggle.tsx |
| Date | Not specified in source |
| Repository | Janady13/llms-txt-hub |
| Revision | e0f4bf978d4df168369c7601d9c5f5ea89e84377 |
| Branch | main |
| Path or archive member | apps/web/components/mode-toggle.tsx |
| Original SHA-256 | da5ab1789db9bcc35a219c1d175b16d1ebce8c2cbae5b8dbc8600983ec453b39 |
| Git blob SHA | 71ad2783d238537ad18b92eeeebae58f9de06527 |
| Reading-copy SHA-256 | da5ab1789db9bcc35a219c1d175b16d1ebce8c2cbae5b8dbc8600983ec453b39 |
Recovered source transcript
Download complete source text ↓22 lines · 0.7 KB
'use client'
import { Button } from '@thedaviddias/design-system/button'
import { Moon, Sun } from 'lucide-react'
import { useTheme } from 'next-themes'
export function ModeToggle() {
const { theme, setTheme } = useTheme()
return (
<Button
variant="ghost"
size="icon"
onClick={() => setTheme(theme === 'light' ? 'dark' : 'light')}
>
<Sun className="h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
<Moon className="absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
<span className="sr-only">Toggle theme</span>
</Button>
)
}