"use client"; import Link from "next/link"; import { usePathname } from "next/navigation"; import styles from "../styles/predictions.module.css"; const MAIN_TABS = [ { href: "/predictions", label: "Pronostics", exact: true }, { href: "/predictions/recap", label: "Récap", exact: false }, { href: "/predictions/indices", label: "Indices", exact: false }, ]; export function MainTabBar() { const pathname = usePathname(); return (
{MAIN_TABS.map(({ href, label, exact }) => { const isActive = exact ? pathname === href : pathname.startsWith(href); return ( {label} ); })}
); }