import { useWorkflowConfigByName as e } from "../../hooks/useWorkflows.js";
import { Button as t } from "../../components/ui/button.js";
import n from "./WorkflowItem.js";
import r from "./components/WorkbenchSettingsModal.js";
import i from "./components/buttons/WorkflowButtons.js";
import { useWorkflowListState as a } from "./hooks/useWorkflowListState.js";
import { useState as o } from "react";
import { jsx as s, jsxs as c } from "react/jsx-runtime";
import { ArrowDownIcon as l } from "lucide-react";
//#region src/features/workbench/WorkflowList.tsx
var u = ({ workflow: u }) => {
	let [d, f] = o(!1), [p, m] = o({
		enableDebugMode: !1,
		showFullMessageHistory: !1
	}), { listRef: h, scrollTo: g, canScrollDown: _, scrollToBottom: v } = a(), y = e(u.className ?? void 0);
	return /* @__PURE__ */ c("div", { children: [_ && /* @__PURE__ */ s(t, {
		variant: "outline",
		size: "icon",
		onClick: v,
		className: "bg-background/80 fixed right-[calc(var(--sidebar-width)+1.5rem)] bottom-6 z-50 rounded-full shadow-md backdrop-blur-sm",
		children: /* @__PURE__ */ s(l, { className: "size-4" })
	}), /* @__PURE__ */ c("div", {
		className: "mb-10",
		ref: h,
		children: [/* @__PURE__ */ s("div", {
			className: "bg-background/95 supports-[backdrop-filter]:bg-background/60 sticky top-0 z-10 backdrop-blur",
			children: /* @__PURE__ */ c("div", {
				className: "flex w-full items-center gap-2 rounded-md p-2 px-3 text-left text-sm font-medium",
				children: [
					/* @__PURE__ */ s("span", {
						className: "flex-1 truncate text-sm",
						children: y.data?.title ?? u.alias
					}),
					/* @__PURE__ */ s(i, {
						workflow: u,
						workflowId: u.id
					}),
					/* @__PURE__ */ s(r, {
						settings: p,
						onSettingsChange: m,
						open: d,
						onOpenChange: f
					})
				]
			})
		}), /* @__PURE__ */ s("div", {
			className: "max-w-4xl py-1",
			children: /* @__PURE__ */ s(n, {
				workflow: u,
				workflowId: u.id,
				scrollTo: g,
				settings: p
			})
		})]
	})] });
};
//#endregion
export { u as default };
