2025-03-11 14:57:23 +08:00
|
|
|
import {ReactNode} from 'react'
|
|
|
|
|
import {Metadata} from 'next'
|
|
|
|
|
import './globals.css'
|
|
|
|
|
import localFont from 'next/font/local'
|
2025-03-19 15:49:18 +08:00
|
|
|
import {Toaster} from '@/components/ui/sonner'
|
2025-04-23 19:00:53 +08:00
|
|
|
import StoreProvider from '@/components/providers/StoreProvider'
|
2025-04-08 11:21:58 +08:00
|
|
|
import {getProfile} from '@/actions/auth/auth'
|
2025-03-19 15:49:18 +08:00
|
|
|
|
|
|
|
|
const font = localFont({
|
|
|
|
|
src: './NotoSansSC-VariableFont_wght.ttf',
|
|
|
|
|
})
|
2025-03-04 10:10:35 +08:00
|
|
|
|
|
|
|
|
export const metadata: Metadata = {
|
2025-03-11 14:57:23 +08:00
|
|
|
title: 'Create Next App',
|
|
|
|
|
description: 'Generated by create next app',
|
|
|
|
|
}
|
2025-03-04 10:10:35 +08:00
|
|
|
|
2025-04-08 11:21:58 +08:00
|
|
|
export default async function RootLayout({
|
2025-03-04 10:10:35 +08:00
|
|
|
children,
|
|
|
|
|
}: Readonly<{
|
2025-04-07 15:42:09 +08:00
|
|
|
children: ReactNode
|
2025-03-04 10:10:35 +08:00
|
|
|
}>) {
|
2025-04-23 19:00:53 +08:00
|
|
|
|
|
|
|
|
const user = await getProfile()
|
|
|
|
|
|
2025-03-04 10:10:35 +08:00
|
|
|
return (
|
2025-03-11 14:57:23 +08:00
|
|
|
<html lang="zh-Cn">
|
2025-03-24 11:45:54 +08:00
|
|
|
<body className={`${font.className}`}>
|
2025-04-23 19:00:53 +08:00
|
|
|
<StoreProvider user={user}>
|
2025-04-08 11:21:58 +08:00
|
|
|
{children}
|
2025-04-23 19:00:53 +08:00
|
|
|
</StoreProvider>
|
2025-04-08 11:21:58 +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
|
|
|
}
|