2025-12-11 14:10:52 +08:00
|
|
|
import './globals.css'
|
2025-03-11 14:57:23 +08:00
|
|
|
import {ReactNode} from 'react'
|
|
|
|
|
import {Metadata} from 'next'
|
2025-03-19 15:49:18 +08:00
|
|
|
import {Toaster} from '@/components/ui/sonner'
|
2025-06-18 17:57:12 +08:00
|
|
|
import Effects from '@/app/effects'
|
2025-12-11 14:10:52 +08:00
|
|
|
import {ProfileStoreProvider} from '@/components/stores/profile'
|
|
|
|
|
import {LayoutStoreProvider} from '@/components/stores/layout'
|
|
|
|
|
import {ClientStoreProvider} from '@/components/stores/client'
|
|
|
|
|
import {getProfile} from '@/actions/auth'
|
2026-01-12 18:28:50 +08:00
|
|
|
import Script from 'next/script'
|
2025-03-04 10:10:35 +08:00
|
|
|
|
2025-04-26 14:18:08 +08:00
|
|
|
export async function generateMetadata(): Promise<Metadata> {
|
|
|
|
|
return {
|
2025-06-05 16:41:30 +08:00
|
|
|
title: '蓝狐代理',
|
2025-04-26 14:18:08 +08:00
|
|
|
}
|
2025-03-11 14:57:23 +08:00
|
|
|
}
|
2025-03-04 10:10:35 +08:00
|
|
|
|
2025-12-11 14:10:52 +08:00
|
|
|
export default async function RootLayout(props: Readonly<{
|
2025-04-07 15:42:09 +08:00
|
|
|
children: ReactNode
|
2025-03-04 10:10:35 +08:00
|
|
|
}>) {
|
|
|
|
|
return (
|
2025-04-25 09:19:31 +08:00
|
|
|
<html lang="zh-CN">
|
2025-12-04 19:07:48 +08:00
|
|
|
<body>
|
2025-12-11 14:10:52 +08:00
|
|
|
<StoreProviders>
|
|
|
|
|
<Effects>{props.children}</Effects>
|
|
|
|
|
</StoreProviders>
|
2025-06-07 11:49:57 +08:00
|
|
|
<Toaster position="top-center" richColors expand/>
|
2025-03-04 10:10:35 +08:00
|
|
|
</body>
|
|
|
|
|
</html>
|
2025-03-11 14:57:23 +08:00
|
|
|
)
|
2025-03-04 10:10:35 +08:00
|
|
|
}
|
2025-12-11 14:10:52 +08:00
|
|
|
|
|
|
|
|
function StoreProviders(props: {children: ReactNode}) {
|
|
|
|
|
return (
|
|
|
|
|
<ProfileStoreProvider profile={getProfile().then(resp => resp.success ? resp.data : null)}>
|
|
|
|
|
<LayoutStoreProvider>
|
|
|
|
|
<ClientStoreProvider>
|
|
|
|
|
{props.children}
|
|
|
|
|
</ClientStoreProvider>
|
|
|
|
|
</LayoutStoreProvider>
|
|
|
|
|
</ProfileStoreProvider>
|
|
|
|
|
)
|
|
|
|
|
}
|