'use client';

import { NavButton } from './nav-button';
import { BookOpen, Newspaper, PlusCircle, User, Users } from 'lucide-react';
import { usePathname } from 'next/navigation';

export function BottomNav() {
  const pathname = usePathname();

  const isFirstLevel = pathname.split('/').length <= 2;
  if (!isFirstLevel) return null;

  return (
    <nav className="sticky inset-x-0 bottom-0 border-t border-border bg-background">
      <div className="grid grid-cols-5">
        <NavButton disabled href="/dashboard" icon={<Newspaper />} label="Главное" />
        <NavButton href="/orders" icon={<BookOpen />} label="Записи" />
        <NavButton href="/orders/add" icon={<PlusCircle />} label="Новая запись" />
        <NavButton href="/contacts" icon={<Users />} label="Контакты" />
        <NavButton href="/profile" icon={<User />} label="Профиль" />
      </div>
    </nav>
  );
}
