import { Link, useLocation } from 'react-router-dom';
import { cn } from '@/lib/utils';
import { RecentReportsDropdown } from '../RecentReportsDropdown';

export function Header() {
  const location = useLocation();

  return (
    <header className="border-b bg-background sticky top-0 z-50 w-full border-border/40 backdrop-blur supports-[backdrop-filter]:bg-background/60">
      <div className="container mx-auto flex h-16 items-center justify-between px-4">
        <div className="flex items-center gap-6">
          <Link to="/" className="flex items-center space-x-2">
            <span className="text-lg font-bold tracking-tight">FA Platform</span>
          </Link>
          <nav className="flex items-center gap-4 text-sm font-medium">
            <Link
              to="/"
              className={cn(
                "transition-colors hover:text-foreground/80",
                location.pathname === "/" ? "text-foreground" : "text-foreground/60"
              )}
            >
              首页
            </Link>
            <Link
              to="/docs"
              className={cn(
                "transition-colors hover:text-foreground/80",
                location.pathname.startsWith("/docs") ? "text-foreground" : "text-foreground/60"
              )}
            >
              文档
            </Link>
            <Link
              to="/config"
              className={cn(
                "transition-colors hover:text-foreground/80",
                location.pathname.startsWith("/config") ? "text-foreground" : "text-foreground/60"
              )}
            >
              配置
            </Link>
          </nav>
        </div>
        <div className="flex items-center gap-2">
          <RecentReportsDropdown />
        </div>
      </div>
    </header>
  );
}
