TypeScript 98.3%
CSS 0.9%
Shell 0.7%
1"use client";2// Sous-navigation horizontale du tableau de bord d'administration.3import Link from "next/link";4import { usePathname } from "next/navigation";5import { cn } from "@/components/ui";67const ITEMS = [8 { href: "/admin", label: "Vue générale" },9 { href: "/admin/cours", label: "Cours & contenu" },10 { href: "/admin/modeles", label: "Modèles" },11 { href: "/admin/pedagogie", label: "Pédagogie" },12 { href: "/admin/prompts", label: "Prompts" },13 { href: "/admin/annonces", label: "Annonces" },14 { href: "/admin/securite", label: "Sécurité" },15 { href: "/admin/parametres", label: "Paramètres" },16];1718export function AdminNav() {19 const pathname = usePathname();20 const isActive = (href: string) => (href === "/admin" ? pathname === "/admin" : pathname === href || pathname.startsWith(href + "/"));21 return (22 <div className="sticky top-0 z-30 border-b border-app bg-app/95 backdrop-blur">23 <nav aria-label="Administration" className="flex gap-1 overflow-x-auto px-4 py-2 md:px-8 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden">24 {ITEMS.map((item) => (25 <Link26 key={item.href}27 href={item.href}28 aria-current={isActive(item.href) ? "page" : undefined}29 className={cn(30 "whitespace-nowrap rounded-lg px-3 py-1.5 text-[13px] font-medium transition-colors",31 isActive(item.href)32 ? "bg-brand-100 text-brand-700 dark:bg-brand-900/60 dark:text-brand-200"33 : "text-muted hover:bg-surface-2 hover:text-fg dark:hover:bg-brand-900/30"34 )}35 >36 {item.label}37 </Link>38 ))}39 </nav>40 </div>41 );42}43