import { Badge } from "../../components/ui/badge.js";
import { c } from "react/compiler-runtime";
import { jsx, jsxs } from "react/jsx-runtime";
import { Link } from "react-router-dom";
function RunItem(a) {
	let o = c(26), { run: s, router: l } = a, u = {
		completed: "bg-green-50 text-green-900 border-green-200",
		failed: "bg-destructive/10 text-destructive border-destructive/20",
		canceled: "bg-orange-50 text-orange-900 border-orange-200",
		running: "bg-blue-50 text-blue-900 border-blue-200",
		paused: "bg-yellow-50 text-yellow-900 border-yellow-200",
		pending: "bg-muted text-muted-foreground border-border"
	}[s.status] || "bg-muted text-muted-foreground border-border", d;
	o[0] !== l || o[1] !== s.id ? (d = l.getPipeline(s.id), o[0] = l, o[1] = s.id, o[2] = d) : d = o[2];
	let f = s.id, p = s.run ?? s.index ?? "?", m = s.title ? `(${s.title})` : "", h;
	o[3] !== p || o[4] !== m ? (h = /* @__PURE__ */ jsxs("h3", {
		className: "text-foreground group-hover:text-primary truncate font-semibold transition-colors",
		children: [
			"Run #",
			p,
			" ",
			m
		]
	}), o[3] = p, o[4] = m, o[5] = h) : h = o[5];
	let g = `rounded-full border px-2 py-1 text-xs whitespace-nowrap ${u}`, _;
	o[6] !== s.status || o[7] !== g ? (_ = /* @__PURE__ */ jsx(Badge, {
		className: g,
		children: s.status
	}), o[6] = s.status, o[7] = g, o[8] = _) : _ = o[8];
	let v;
	o[9] === s.updatedAt ? v = o[10] : (v = new Date(s.updatedAt).toLocaleString(), o[9] = s.updatedAt, o[10] = v);
	let y;
	o[11] === v ? y = o[12] : (y = /* @__PURE__ */ jsx("span", {
		className: "text-muted-foreground text-xs",
		children: v
	}), o[11] = v, o[12] = y);
	let b;
	o[13] !== _ || o[14] !== y ? (b = /* @__PURE__ */ jsxs("div", {
		className: "mt-2 flex flex-wrap items-center gap-2",
		children: [_, y]
	}), o[13] = _, o[14] = y, o[15] = b) : b = o[15];
	let x;
	o[16] !== b || o[17] !== h ? (x = /* @__PURE__ */ jsxs("div", {
		className: "min-w-0 flex-1 pr-2",
		children: [h, b]
	}), o[16] = b, o[17] = h, o[18] = x) : x = o[18];
	let S;
	o[19] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ jsx("div", {
		className: "ml-3 opacity-0 transition-opacity group-hover:opacity-100",
		children: /* @__PURE__ */ jsx("svg", {
			className: "text-muted-foreground h-4 w-4",
			fill: "none",
			stroke: "currentColor",
			viewBox: "0 0 24 24",
			children: /* @__PURE__ */ jsx("path", {
				strokeLinecap: "round",
				strokeLinejoin: "round",
				strokeWidth: 2,
				d: "M9 5l7 7-7 7"
			})
		})
	}), o[19] = S) : S = o[19];
	let C;
	o[20] === x ? C = o[21] : (C = /* @__PURE__ */ jsxs("div", {
		className: "flex min-w-0 items-start justify-between",
		children: [x, S]
	}), o[20] = x, o[21] = C);
	let w;
	return o[22] !== s.id || o[23] !== d || o[24] !== C ? (w = /* @__PURE__ */ jsx(Link, {
		to: d,
		className: "bg-card border-border hover:border-primary/50 group block w-full overflow-hidden rounded-lg border p-4 transition-all duration-200 hover:shadow-md",
		children: C
	}, f), o[22] = s.id, o[23] = d, o[24] = C, o[25] = w) : w = o[25], w;
}
var RunItem_default = RunItem;
export { RunItem_default as default };
