"use client";

import { usePathname, useRouter } from 'next/navigation';
import { Button } from '../src/components/ui/button';

const examples = [
  { name: "Chat", href: "/chat" },
  { name: "Meet", href: "/meet" },
  { name: "Dashboard", href: "/dashboard" },
  { name: "Mail", href: "/mail" },
  { name: "Tree", href: "/tree" },
  { name: "Editor", href: "/editor" },
  { name: "Tables", href: "/table" },
  { name: "Videos", href: "/videos" },
  { name: "Music", href: "/music" },
  { name: "Templates", href: "/templates" },
  { name: "Settings", href: "/settings" },
];

export function Nav() {
  const pathname = usePathname();
  const router = useRouter();

  return (
    <div className="examples-nav-container">
      <div className="examples-nav-inner">
        {examples.map((example) => (
          <Button
            key={example.href}
            onClick={() => router.push(example.href)}
            className={`example-button ${pathname === example.href ? 'active' : ''}`}
          >
            {example.name}
          </Button>
        ))}
      </div>
    </div>
  );
}