app/components/breadcrumb.tsx
20 lines and 2 functions in DrDustinEdwards/dustinedwards-info, at commit 1590ba4 on 2026-10-24. This file on GitHub.
Functions
| Function | Lines | Complexity | Covered | CRAP | Mutation |
|---|---|---|---|---|---|
| Breadcrumb | 4 to 21 | 2 | No data: no coverage report in this map | No data: no coverage report in this map | No data: no mutants in this code |
| <anonymous:9> | 9 to 17 | 3 | No data: no coverage report in this map | No data: no coverage report in this map | No data: no mutants in this code |
Imports
It imports no other module of this repo. Imported by app/routes/content-page.tsx, app/routes/kb-library.tsx, app/routes/lab.kind.tsx, app/routes/lab.tsx, app/routes/phages.tsx, app/routes/procedure.tsx, app/routes/procedure.version.tsx, app/routes/protocols.tsx, app/routes/publications.$slug.tsx, app/routes/systems.tsx.
Source
import { Link } from "react-router";
/** Visible trail. The last step is the current page. Hubs (one step) render nothing. */
export function Breadcrumb({ trail }: { trail: Array<[string, string]> }) {
if (trail.length < 2) return null;
return (
<nav className="page-breadcrumb" aria-label="Breadcrumb">
<ol>
{trail.map(([name, path], i) => {
const last = i === trail.length - 1;
return (
<li key={`${path}-${i}`}>
{last ? <span aria-current="page">{name}</span> : <Link to={path}>{name}</Link>}
{last ? null : <span aria-hidden="true"> / </span>}
</li>
);
})}
</ol>
</nav>
);
}