Skip to the content

Capsid menu

app/components/lab/lab-ui.tsx

33 lines and 3 functions in DrDustinEdwards/dustinedwards-info, at commit 1590ba4 on 2026-10-24. This file on GitHub.

Functions

The functions of lab-ui.tsx
FunctionLinesComplexityCoveredCRAPMutation
Result7 to 163No data: no coverage report in this mapNo data: no coverage report in this mapNo data: no mutants in this code
LabTable19 to 361No data: no coverage report in this mapNo data: no coverage report in this mapNo data: no mutants in this code
<anonymous:25>25 to 291No 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/workspace.inventory.lot.tsx, app/routes/workspace.inventory.tsx, app/routes/workspace.runs.run.tsx, app/routes/workspace.runs.tsx.

Source

// The small pieces the /lab pages share: a post's result line and a table in Capsomer's scrolling region.

import type { ReactNode } from "react";
import { Alert } from "capsomer/react/banner";

/** The answer to the last post: a status line when it worked, an alert when it did not. */
export function Result({ result }: { result?: { ok: boolean; text: string } | null }) {
  if (!result) return null;
  return result.ok ? (
    <p className="cap-muted" role="status">
      Done: {result.text}
    </p>
  ) : (
    <Alert tone="crit">Not done: {result.text}</Alert>
  );
}

/** A table that scrolls on a phone in a labelled, focusable region (DEFAULTS.md). */
export function LabTable({ label, head, children }: { label: string; head: string[]; children: ReactNode }) {
  return (
    <div className="cap-table-wrap" role="region" aria-label={label} tabIndex={0}>
      <table className="cap-table">
        <thead>
          <tr>
            {head.map((h) => (
              <th scope="col" key={h}>
                {h}
              </th>
            ))}
          </tr>
        </thead>
        <tbody>{children}</tbody>
      </table>
    </div>
  );
}