AdvisorsLayout.tsx27 lines · main
| 1 | import { useRouter } from 'next/router' |
| 2 | import { PropsWithChildren } from 'react' |
| 3 | |
| 4 | import { ProjectLayout } from '../ProjectLayout' |
| 5 | import { AdvisorsSidebarMenu } from './AdvisorsSidebarMenu' |
| 6 | import { withAuth } from '@/hooks/misc/withAuth' |
| 7 | |
| 8 | export interface AdvisorsLayoutProps { |
| 9 | title?: string |
| 10 | } |
| 11 | |
| 12 | const 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 | |
| 27 | export default withAuth(AdvisorsLayout) |