spb/cancerindex
Public
TypeScript 97.2%
SQL 1.5%
CSS 0.6%
JavaScript 0.5%
1import Link from 'next/link';2import { ChevronRight } from 'lucide-react';34export interface Crumb {5 label: string;6 href?: string;7}89export function Breadcrumbs({ items, className = '' }: { items: Crumb[]; className?: string }) {10 if (items.length === 0) return null;11 return (12 <nav aria-label="Breadcrumb" className={`overflow-x-auto text-[12.5px] text-ink-3 ${className}`}>13 <ol className="flex items-center gap-1 whitespace-nowrap">14 {items.map((c, i) => (15 <li key={`${c.label}-${i}`} className="flex items-center gap-1">16 {i > 0 ? <ChevronRight className="h-3 w-3 text-ink-4" aria-hidden /> : null}17 {c.href && i < items.length - 1 ? (18 <Link href={c.href} className="text-ink-2 no-underline hover:text-accent">19 {c.label}20 </Link>21 ) : (22 <span aria-current={i === items.length - 1 ? 'page' : undefined} className={i === items.length - 1 ? 'text-ink' : ''}>23 {c.label}24 </span>25 )}26 </li>27 ))}28 </ol>29 </nav>30 );31}32