AdvisorsLayout.tsx27 lines · main
1import { useRouter } from 'next/router'
2import { PropsWithChildren } from 'react'
3
4import { ProjectLayout } from '../ProjectLayout'
5import { AdvisorsSidebarMenu } from './AdvisorsSidebarMenu'
6import { withAuth } from '@/hooks/misc/withAuth'
7
8export interface AdvisorsLayoutProps {
9 title?: string
10}
11
12const AdvisorsLayout = ({ children }: PropsWithChildren<AdvisorsLayoutProps>) => {
13 const router = useRouter()
14 const page = router.pathname.split('/')[4]
15
16 return (
17 <ProjectLayout
18 isLoading={false}
19 product="Advisors"
20 productMenu={<AdvisorsSidebarMenu page={page} />}
21 >
22 {children}
23 </ProjectLayout>
24 )
25}
26
27export default withAuth(AdvisorsLayout)