This commit is contained in:
parent
8d3643ebf1
commit
617780ef4b
|
|
@ -1,12 +1,14 @@
|
|||
import type { Metadata, Viewport } from 'next'
|
||||
import { Inter as FontSans } from 'next/font/google'
|
||||
import { AI } from './action'
|
||||
import '../../globals.css'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { ThemeProvider } from '@/components/mpv2/theme-provider'
|
||||
import Header from '@/components/mpv2/header'
|
||||
import Footer from '@/components/mpv2/footer'
|
||||
|
||||
import { AIProvider } from 'ai/rsc' // ✅ 关键点
|
||||
import { AI } from './action' // ✅ 注意这里的引号
|
||||
|
||||
const fontSans = FontSans({
|
||||
subsets: ['latin'],
|
||||
variable: '--font-sans'
|
||||
|
|
@ -40,22 +42,13 @@ export const viewport: Viewport = {
|
|||
}
|
||||
|
||||
// ✅ 这里类型一定要这样!不能直接 children: React.ReactNode
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode
|
||||
}) {
|
||||
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<ThemeProvider
|
||||
attribute="class"
|
||||
defaultTheme="system"
|
||||
enableSystem
|
||||
disableTransitionOnChange
|
||||
>
|
||||
<ThemeProvider attribute="class" defaultTheme="system" enableSystem disableTransitionOnChange>
|
||||
{/* <Header /> */}
|
||||
<AI>
|
||||
<AIProvider value={AI}>
|
||||
{children}
|
||||
</AI>
|
||||
</AIProvider>
|
||||
{/* <Footer /> */}
|
||||
</ThemeProvider>
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue