19 lines
360 B
TypeScript
19 lines
360 B
TypeScript
"use client"
|
|
|
|
import { useEffect } from "react"
|
|
|
|
import { type Theme, THEMES } from "@/utils/theme/types"
|
|
|
|
interface ThemeUpdaterProps {
|
|
theme: Theme
|
|
}
|
|
|
|
export default function ThemeUpdater({ theme }: ThemeUpdaterProps) {
|
|
useEffect(() => {
|
|
document.body.classList.remove(...THEMES)
|
|
document.body.classList.add(theme)
|
|
}, [theme])
|
|
|
|
return null
|
|
}
|