AdvisorsLayout.tsx 685 B

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