'use client'
import { useSyncExternalStore } from 'react'
import { readServerTheme, readTheme, subscribeTheme, writeTheme } from '@/shared/helpers/theme'
export function ThemeToggle() {
const theme = useSyncExternalStore(subscribeTheme, readTheme, readServerTheme)
const label = theme === 'light' ? 'Switch to dark theme' : 'Switch to light theme'
return (
)
}
function SunIcon() {
return (
)
}
function MoonIcon() {
return (
)
}