"use client";

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

const TABS = [
  { href: "/analytics", label: "Свердл рынок" },
  { href: "/analytics/prinzip", label: "PRINZIP" },
  { href: "/analytics/developers", label: "Девелоперы" },
  { href: "/analytics/recommend", label: "Рекомендатор" },
];

export function AnalyticsNav() {
  const pathname = usePathname();
  return (
    <nav
      className="gd-nav-scroll"
      style={{
        display: "flex",
        gap: 8,
        borderBottom: "1px solid var(--border-card)",
        marginBottom: 16,
      }}
    >
      {TABS.map((tab) => {
        const active = pathname === tab.href;
        return (
          <Link
            key={tab.href}
            href={tab.href}
            style={{
              padding: "10px 14px",
              borderBottom: active
                ? "2px solid var(--accent)"
                : "2px solid transparent",
              color: active ? "var(--accent)" : "var(--fg-secondary)",
              fontWeight: active ? 600 : 500,
              textDecoration: "none",
              fontSize: 14,
              whiteSpace: "nowrap",
            }}
          >
            {tab.label}
          </Link>
        );
      })}
    </nav>
  );
}
