'use client';

import Link from 'next/link';
import { usePathname } from 'next/navigation';

const TABS = [
	{ href: '/feed/all', label: '전체' },
	{ href: '/feed/foryou', label: '추천' },
	{ href: '/feed/following', label: '팔로잉' }
] as const;

export default function FeedTabs() {
	const pathname = usePathname();

	return (
		<nav className="feed__tabs" aria-label="피드 탭">
			{TABS.map((tab) => {
				const active = pathname === tab.href;
				return (
					<Link
						key={tab.href}
						href={tab.href}
						className={`feed__tab${active ? ' feed__tab--active' : ''}`}
						aria-current={active ? 'page' : undefined}
					>
						{tab.label}
					</Link>
				);
			})}
		</nav>
	);
}