import { h } from "preact"; /** * Pure rendering logic for the bindings editor, split out from * bindings.jsx so it is unit-testable without the page's fetch wiring, * mirroring mappings/mapping-editor.jsx. */ function Pill({ text, kind = "idle" }) { return {text}; } const STATUS_LABELS = { draft: "draft", pending_approval: "pending approval", armed: "armed", }; const STATUS_KINDS = { draft: "idle", pending_approval: "warn", armed: "ok", }; /** Renders a binding's Status as a labeled pill -- draft/pending_approval/armed. */ export function StatusPill({ status }) { return ; } /** One saved binding's summary row for the bindings list. */ export function BindingRow({ binding: b, onEdit, onApprove, onDelete }) { const repoPin = b.owner && b.repo ? `${b.owner}/${b.repo}` : "—"; return ( {b.name} {b.matcher?.source || "—"} {b.workflow} {repoPin} {b.status === "pending_approval" && ( )} ); }