SPB Git

Repository Public

Breadcrumbs.tsx 2.8 KB 86 lines tsx

1/**2 * =============================================================================3 *                  SP BOUCHER | SOFTWARE & RESEARCH4 *             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5 * =============================================================================6 *7 * Project          : agentilab-web8 * File             : components/layout/Breadcrumbs.tsx9 * Module           : User Interface10 * Repository       : https://git.spboucher.ai/agentilab-web11 * Project Website  : Not specified12 * Created          : 2026-12-0513 * Last Modified    : 2026-12-0514 *15 * Author           : Simon-Pierre Boucher16 * Position         : Professor of Finance17 * Institution      : Université du Québec en Outaouais (UQO)18 * Organization     : SP Boucher19 * Website          : https://spboucher.ai20 * Git              : https://git.spboucher.ai21 *22 * Preferred Contact: contact@spboucher.ai23 * Development      : dev@spboucher.ai24 * Support          : support@spboucher.ai25 * Security/Admin   : admin@spboucher.ai26 *27 * Copyright (c) 202628 * Simon-Pierre Boucher29 * All rights reserved where applicable. This file is governed by the30 * applicable project license, copyright notices and relevant law.31 * Existing third-party rights and notices remain unaffected.32 *33 * License          : Proprietary34 *35 * Do not embed credentials, private keys, access tokens,36 * certificates or confidential personal information.37 *38 * =============================================================================39 * END OF SP BOUCHER SOURCE HEADER40 * =============================================================================41 */4243import Link from 'next/link';44import type { Locale } from '@/lib/i18n/config';45import { getCopy } from '@/lib/i18n/copy';46import { href, trail } from '@/lib/i18n/routes';47import type { RouteId } from '@/lib/i18n/routes';4849export function crumbLabel(id: RouteId, locale: Locale): string {50  const copy = getCopy(locale);51  switch (id) {52    case 'home':53      return copy.nav.home;54    case 'groupeKa':55      return 'Groupe Ka';56    case 'orix':57      return 'ORIX';58    case 'privacy':59      return copy.privacy.title;60    case 'legal':61      return copy.legal.title;62    default:63      return copy.nav[id];64  }65}6667export function Breadcrumbs({ id, locale }: { id: RouteId; locale: Locale }) {68  const copy = getCopy(locale);69  const items = trail(id);70  return (71    <nav className="crumbs" aria-label={copy.nav.breadcrumb}>72      <ol>73        {items.map((item, index) => (74          <li key={item}>75            {index === items.length - 1 ? (76              <span aria-current="page">{crumbLabel(item, locale)}</span>77            ) : (78              <Link href={href(item, locale)}>{crumbLabel(item, locale)}</Link>79            )}80          </li>81        ))}82      </ol>83    </nav>84  );85}86
Files main
Menu

Theme