import { useStudio as e } from "../../providers/StudioProvider.js";
import { Card as t, CardContent as n, CardHeader as r, CardTitle as i } from "../../components/ui/card.js";
import a from "./RunList.js";
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
import { Link as l } from "react-router-dom";
//#region src/features/dashboard/Dashboard.tsx
function u({ dashboardStats: u }) {
	let { router: d } = e();
	return u ? /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ c("div", {
		className: "mb-8 grid grid-cols-1 gap-6 md:grid-cols-4",
		children: [/* @__PURE__ */ s("div", {
			className: "md:col-span-1",
			children: /* @__PURE__ */ c(t, {
				className: "h-full",
				children: [
					/* @__PURE__ */ s(r, { children: /* @__PURE__ */ s(i, {
						className: "text-lg",
						children: "Quick Links"
					}) }),
					/* @__PURE__ */ s(n, {
						className: "space-y-3",
						children: /* @__PURE__ */ s(l, {
							to: d.getWorkspaces(),
							className: "text-primary hover:text-primary/80 hover:bg-muted block rounded p-2 text-sm font-medium transition-colors",
							children: "My Workspaces"
						})
					}),
					/* @__PURE__ */ s(n, {
						className: "space-y-3",
						children: /* @__PURE__ */ s(l, {
							to: d.getDebugWorkflows(),
							className: "text-primary hover:text-primary/80 hover:bg-muted block rounded p-2 text-sm font-medium transition-colors",
							children: "Debug Workflows"
						})
					})
				]
			})
		}), /* @__PURE__ */ c("div", {
			className: "grid grid-cols-1 gap-4 md:col-span-3 md:grid-cols-3",
			children: [
				/* @__PURE__ */ c(t, { children: [/* @__PURE__ */ s(r, { children: /* @__PURE__ */ s(i, {
					className: "text-lg",
					children: "Executions"
				}) }), /* @__PURE__ */ s(n, { children: /* @__PURE__ */ s("p", {
					className: "text-3xl font-bold",
					children: u.totalAutomationRuns
				}) })] }),
				/* @__PURE__ */ c(t, { children: [/* @__PURE__ */ s(r, { children: /* @__PURE__ */ s(i, {
					className: "text-lg",
					children: "Completed"
				}) }), /* @__PURE__ */ s(n, { children: /* @__PURE__ */ s("p", {
					className: "text-3xl font-bold text-green-600",
					children: u.completedRuns
				}) })] }),
				/* @__PURE__ */ c(t, { children: [/* @__PURE__ */ s(r, { children: /* @__PURE__ */ s(i, {
					className: "text-lg",
					children: "Failed"
				}) }), /* @__PURE__ */ s(n, { children: /* @__PURE__ */ s("p", {
					className: "text-destructive text-3xl font-bold",
					children: u.errorRuns
				}) })] })
			]
		})]
	}), /* @__PURE__ */ c("div", {
		className: "grid grid-cols-1 gap-6 md:grid-cols-2",
		children: [/* @__PURE__ */ c(t, { children: [/* @__PURE__ */ s(r, { children: /* @__PURE__ */ s(i, { children: "Recently Completed" }) }), /* @__PURE__ */ s(n, { children: /* @__PURE__ */ s(a, {
			type: "runs",
			runs: u.recentRuns,
			router: d,
			emptyMessage: "No recent runs."
		}) })] }), /* @__PURE__ */ c(t, { children: [/* @__PURE__ */ s(r, { children: /* @__PURE__ */ s(i, { children: "Recently Failed" }) }), /* @__PURE__ */ s(n, { children: /* @__PURE__ */ s(a, {
			type: "errors",
			runs: u.recentErrors,
			router: d,
			emptyMessage: "No recent errors."
		}) })] })]
	})] }) : /* @__PURE__ */ s("div", {
		className: "p-4",
		children: "No data available"
	});
}
//#endregion
export { u as default };
