import { For, Show } from "solid-js"; import type { GraphRow, RefBadge } from "../lib/bindings"; import { absoluteTime, isoTime, relativeTime, shortId } from "../lib/format"; import GraphLanes from "./GraphLanes"; /** What a ref badge is, spoken rather than shown. */ function describe(badge: RefBadge): string { switch (badge.kind) { case "localBranch": return badge.isHead ? "current branch" : "branch"; case "remoteBranch": return "remote branch"; case "tag": return "tag"; case "other": return "reference"; } } /** * One commit. * * The row is a button because selecting a commit is an action, and a button * brings its own role, focus ring and Enter/Space handling. That constrains the * contents to phrasing content — which is why the ref badges are spans rather * than a list. */ export default function CommitRow(props: { row: GraphRow; isSelected: boolean; onSelect: () => void; onKeyDown: (event: KeyboardEvent) => void; }) { return (
  • ); }