File size: 589 Bytes
bea55e2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'use client';

import { usePathname } from 'next/navigation';
import { MobileNav } from '@/components/mobile-nav';

const ROUTES_WITHOUT_NAV = ['/login', '/search', '/shorts', '/videos'];

export function NavShell({ children }: { children: React.ReactNode }) {
  const pathname = usePathname();
  const hideMobileNav = ROUTES_WITHOUT_NAV.some(route => pathname === route) || pathname.startsWith('/product');

  return (
    <>
      <main className={`flex-1 ${hideMobileNav ? '' : 'pb-28 md:pb-0'}`}>
        {children}
      </main>
      {!hideMobileNav && <MobileNav />}
    </>
  );
}