mirror of
https://github.com/hanzoai/gui.git
synced 2026-10-25 02:31:41 +00:00
The loader and the Next plugin only existed to drive webpack; Next runs on Turbopack and Vite has its own plugin. kitchen-sink and the integration app serve through vite, the optimizer suite drops the webpack name, and its fixture packages join the workspace so a fresh checkout links @my/ui.
30 lines
851 B
TypeScript
30 lines
851 B
TypeScript
'use client'
|
|
|
|
import '@hanzogui/core/reset.css'
|
|
import '@hanzo/font/css'
|
|
import '@hanzogui/polyfill-dev'
|
|
|
|
import type { ReactNode } from 'react'
|
|
import { NextThemeProvider, useRootTheme } from '@hanzogui/next-theme'
|
|
import { config } from '@my/ui'
|
|
import { Provider } from 'app/provider'
|
|
|
|
// Pages Router provider - uses next/script with beforeInteractive (no skipNextHead)
|
|
export const PagesGuiProvider = ({ children }: { children: ReactNode }) => {
|
|
const [theme, setTheme] = useRootTheme()
|
|
|
|
return (
|
|
<NextThemeProvider
|
|
// Don't skip - let next/script handle injection with beforeInteractive
|
|
defaultTheme="light"
|
|
onChangeTheme={(next) => {
|
|
setTheme(next as any)
|
|
}}
|
|
>
|
|
<Provider disableRootThemeClass defaultTheme={theme || 'light'}>
|
|
{children}
|
|
</Provider>
|
|
</NextThemeProvider>
|
|
)
|
|
}
|