Wraps app in a theme provider for dark/light mode support.
// Source: https://github.com/polarsource/polar | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
'use client'
import { ThemeProvider } from 'next-themes'
import { type ReactNode } from 'react'
export function OrbitThemeProvider({ children }: { children: ReactNode }) {
return (
<ThemeProvider defaultTheme="system" enableSystem attribute="class">
{children}
</ThemeProvider>
)
}
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key