26 lines
607 B
TypeScript
26 lines
607 B
TypeScript
"use client"
|
|
|
|
import { ThemeProvider as NextThemesProvider } from "next-themes"
|
|
import type { ComponentProps } from "react"
|
|
|
|
/** Обёртка над next-themes: тот же storageKey `rl-theme`, класс на `<html>`. */
|
|
export function ThemeProvider({
|
|
children,
|
|
...props
|
|
}: ComponentProps<typeof NextThemesProvider>) {
|
|
return (
|
|
<NextThemesProvider
|
|
attribute="class"
|
|
defaultTheme="dark"
|
|
enableSystem
|
|
storageKey="rl-theme"
|
|
disableTransitionOnChange
|
|
{...props}
|
|
>
|
|
{children}
|
|
</NextThemesProvider>
|
|
)
|
|
}
|
|
|
|
export { useTheme } from "next-themes"
|