feat(web): Pressing Plant component library + describeJob
design.css component classes (masthead, contents nav, tiles, dept header, job row + severity stripe, status chip, progress bar, pressed list, buttons, fields). Presentational _ui components. describeJob maps worker Job.state to literal labels + severity kind + stepped progress (unit-tested). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
import type { ReactNode } from "react";
|
||||
import type { Kind } from "./status";
|
||||
import { ProgressBar } from "./progress-bar";
|
||||
import { StatusChip } from "./status-chip";
|
||||
|
||||
// Map the severity kind to the row's visual class (stripe/bar color).
|
||||
function rowClass(kind: Kind): string {
|
||||
if (kind === "attention") return "attention";
|
||||
if (kind === "verify" || kind === "done") return "verify";
|
||||
return "working";
|
||||
}
|
||||
|
||||
export function JobRow({
|
||||
artist,
|
||||
album,
|
||||
kind,
|
||||
label,
|
||||
step,
|
||||
total,
|
||||
meta,
|
||||
note,
|
||||
indeterminate,
|
||||
}: {
|
||||
artist: string;
|
||||
album: string;
|
||||
kind: Kind;
|
||||
label: string;
|
||||
step: number;
|
||||
total: number;
|
||||
meta?: ReactNode;
|
||||
note?: ReactNode;
|
||||
indeterminate?: boolean;
|
||||
}) {
|
||||
return (
|
||||
<article className={`job ${rowClass(kind)}`}>
|
||||
<div className="stripe" />
|
||||
<div>
|
||||
<h3 className="title">
|
||||
{album} <span className="artist">· {artist}</span>
|
||||
</h3>
|
||||
{meta ? <div className="meta">{meta}</div> : null}
|
||||
{note ? (
|
||||
<div className="note">{note}</div>
|
||||
) : kind !== "attention" ? (
|
||||
<ProgressBar kind={kind} step={step} total={total} indeterminate={indeterminate} />
|
||||
) : null}
|
||||
</div>
|
||||
<StatusChip kind={kind} label={label} />
|
||||
</article>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user