实现响应式导航栏组件

This commit is contained in:
2025-06-18 17:57:12 +08:00
parent ba7d22168d
commit 39f30fcfa9
29 changed files with 742 additions and 223 deletions

View File

@@ -2,16 +2,24 @@ import {ReactNode} from 'react'
import Header from './_client/header'
import Navbar from './_client/navbar'
import Layout from './_client/layout'
import {getProfile} from '@/actions/auth'
import {redirect} from 'next/navigation'
export type AdminLayoutProps = {
children: ReactNode
}
export default async function AdminLayout(props: AdminLayoutProps) {
const resp = await getProfile()
const profile = resp.success ? resp.data : null
if (!profile) {
redirect('/login')
}
return (
<Layout
navbar={<Navbar/>}
header={<Header/>}
header={<Header profile={profile}/>}
content={props.children}
/>
)