tailwind-nextjs-blog/app/theme-providers.tsx

16 lines
346 B
TypeScript
Raw Permalink Normal View History

2023-08-16 23:55:57 +08:00
'use client';
2023-08-16 23:55:57 +08:00
import { ThemeProvider } from 'next-themes';
import siteMetadata from '@/data/siteMetadata';
export function ThemeProviders({ children }: { children: React.ReactNode }) {
return (
2023-08-16 23:55:57 +08:00
<ThemeProvider
attribute="class"
defaultTheme={siteMetadata.theme}
enableSystem>
{children}
</ThemeProvider>
2023-08-16 23:55:57 +08:00
);
}