Skip to the content

Capsid menu

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

The functions of breadcrumb.tsx
FunctionLinesComplexityCoveredCRAPMutation
Breadcrumb4 to 212No data: no coverage report in this mapNo data: no coverage report in this mapNo data: no mutants in this code
<anonymous:9>9 to 173No data: no coverage report in this mapNo data: no coverage report in this mapNo 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>
  );
}