import { Badge as e } from "../../components/ui/badge.js";
import { jsx as t, jsxs as n } from "react/jsx-runtime";
import { Link as r } from "react-router-dom";
//#region src/features/dashboard/RunItem.tsx
function i({ run: i, router: a }) {
	let o = {
		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"
	}[i.status] || "bg-muted text-muted-foreground border-border";
	return /* @__PURE__ */ t(r, {
		to: a.getWorkflow(i.id),
		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: /* @__PURE__ */ n("div", {
			className: "flex min-w-0 items-start justify-between",
			children: [/* @__PURE__ */ n("div", {
				className: "min-w-0 flex-1 pr-2",
				children: [/* @__PURE__ */ n("h3", {
					className: "text-foreground group-hover:text-primary truncate font-semibold transition-colors",
					children: [
						"Run #",
						i.run ?? i.index ?? "?",
						" ",
						i.title ? `(${i.title})` : ""
					]
				}), /* @__PURE__ */ n("div", {
					className: "mt-2 flex flex-wrap items-center gap-2",
					children: [/* @__PURE__ */ t(e, {
						className: `rounded-full border px-2 py-1 text-xs whitespace-nowrap ${o}`,
						children: i.status
					}), /* @__PURE__ */ t("span", {
						className: "text-muted-foreground text-xs",
						children: new Date(i.updatedAt).toLocaleString()
					})]
				})]
			}), /* @__PURE__ */ t("div", {
				className: "ml-3 opacity-0 transition-opacity group-hover:opacity-100",
				children: /* @__PURE__ */ t("svg", {
					className: "text-muted-foreground h-4 w-4",
					fill: "none",
					stroke: "currentColor",
					viewBox: "0 0 24 24",
					children: /* @__PURE__ */ t("path", {
						strokeLinecap: "round",
						strokeLinejoin: "round",
						strokeWidth: 2,
						d: "M9 5l7 7-7 7"
					})
				})
			})]
		})
	}, i.id);
}
//#endregion
export { i as default };
