trading-app/src/components/nav.tsx
David 27a358038a
Some checks failed
Tick / tick (push) Failing after 1s
Cagnotte V1: IA news-driven trading sim, sandbox, PEA tracking, PWA
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 19:06:17 +01:00

39 lines
1.7 KiB
TypeScript

"use client";
import Link from "next/link";
import { usePathname } from "next/navigation";
const TABS = [
{ href: "/", label: "Accueil", icon: "M3 11.5 12 4l9 7.5V20a1 1 0 0 1-1 1h-5v-6h-6v6H4a1 1 0 0 1-1-1z" },
{ href: "/bac-a-sable", label: "Bac à sable", icon: "M4 19h16M6 16l3-6 3 3 4-7 2 10" },
{ href: "/ia", label: "IA", icon: "M12 3v3m0 12v3M3 12h3m12 0h3M7 7h10v10H7zM10 10h4v4h-4z" },
{ href: "/actus", label: "Actus", icon: "M5 4h11a2 2 0 0 1 2 2v13a1 1 0 0 0 2 0V8M5 4v15a1 1 0 0 0 1 1h13M8 8h6M8 12h6M8 16h4" },
{ href: "/reglages", label: "Réglages", icon: "M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM19 12l2-1-2-4-2 .5-1.5-1L15 4h-6l-.5 2.5-1.5 1L5 7l-2 4 2 1v0l-2 1 2 4 2-.5 1.5 1L9 20h6l.5-2.5 1.5-1 2 .5 2-4z" },
];
export function Nav() {
const pathname = usePathname();
return (
<nav className="fixed inset-x-0 bottom-0 z-20 border-t border-line bg-surface/95 pb-[env(safe-area-inset-bottom)] backdrop-blur">
<ul className="mx-auto flex max-w-lg">
{TABS.map((t) => {
const active = t.href === "/" ? pathname === "/" : pathname.startsWith(t.href);
return (
<li key={t.href} className="flex-1">
<Link
href={t.href}
className={`flex flex-col items-center gap-1 py-2.5 text-[11px] font-medium ${active ? "text-accent" : "text-muted"}`}
>
<svg viewBox="0 0 24 24" className="h-6 w-6" fill="none" stroke="currentColor" strokeWidth={1.7} strokeLinecap="round" strokeLinejoin="round" aria-hidden>
<path d={t.icon} />
</svg>
{t.label}
</Link>
</li>
);
})}
</ul>
</nav>
);
}