import { routes } from '@/lib/routing/RouteConfig';
import { Stack } from '@/ui/Stack';
import { Calendar, Home, Layout, Settings, Trophy, Users } from 'lucide-react';
import { NavLink } from './NavLink';

interface AuthedNavProps {
  pathname: string;
  direction?: 'row' | 'col';
}

/**
 * AuthedNav displays navigation items for authenticated users.
 */
export function AuthedNav({ pathname, direction = 'col' }: AuthedNavProps) {
  const items = [
    { label: 'Dashboard', href: routes.protected.dashboard, icon: Home },
    { label: 'Leagues', href: routes.public.leagues, icon: Trophy },
    { label: 'Leaderboards', href: routes.public.leaderboards, icon: Layout },
    { label: 'Teams', href: routes.public.teams, icon: Users },
    { label: 'Races', href: routes.public.races, icon: Calendar },
    { label: 'Settings', href: routes.protected.profileSettings, icon: Settings },
  ];

  return (
    <Stack direction={direction} gap={direction === 'row' ? 4 : 1}>
      {items.map((item) => (
        <NavLink
          key={item.href}
          href={item.href}
          label={item.label}
          icon={item.icon}
          isActive={pathname === item.href}
          variant={direction === 'row' ? 'top' : 'sidebar'}
        />
      ))}
    </Stack>
  );
}
