DocWeave / frontend /src /components /workflow /WorkflowStatusBadge.jsx
shak3008's picture
feat: complete end-to-end platform with all standout behaviors
fcacf10
Raw
History Blame Contribute Delete
850 Bytes
import { Badge } from "../ui";
/**
* Maps the real WorkflowStatus enum (app/models/workflow_run.py) to a tone.
* WAITING_FOR_REVIEW is deliberately "warning" (attention-needed), never
* "danger" — it is a legitimate in-progress state, not a failure.
*/
const TONE_BY_STATUS = {
PENDING: "default",
RUNNING: "accent",
WAITING_FOR_REVIEW: "warning",
COMPLETED: "success",
FAILED: "danger",
CANCELLED: "default",
};
const LABEL_BY_STATUS = {
PENDING: "Pending",
RUNNING: "Processing",
WAITING_FOR_REVIEW: "Waiting for review",
COMPLETED: "Completed",
FAILED: "Failed",
CANCELLED: "Cancelled",
};
export function WorkflowStatusBadge({ status }) {
return (
<Badge tone={TONE_BY_STATUS[status] || "default"} dot>
{LABEL_BY_STATUS[status] || status}
</Badge>
);
}