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