import { Button as e } from "../../../../components/ui/button.js";
import t from "../../../../components/dynamic-form/Form.js";
import n from "./HeaderSection.js";
import { jsx as r, jsxs as i } from "react/jsx-runtime";
import { Loader2 as a, Zap as o } from "lucide-react";
import { useForm as s } from "react-hook-form";
//#region src/features/workspaces/components/workflow-form/ArgumentsView.tsx
var c = ({ config: c, hasArguments: l, isLoading: u, onBack: d, onSubmit: f }) => {
	let p = s({
		defaultValues: {},
		mode: "onChange"
	}), m = (e) => (t) => {
		console.log("handleSubmit"), f(e, t);
	}, h = (e) => {
		p.handleSubmit(m(e))();
	};
	return /* @__PURE__ */ i("div", {
		className: "flex flex-col",
		children: [
			/* @__PURE__ */ r(n, {
				icon: /* @__PURE__ */ r(o, { className: "h-5 w-5" }),
				title: c?.title || c?.alias || "",
				description: c?.description,
				showBack: !0,
				onBack: d
			}),
			/* @__PURE__ */ r("div", {
				className: "border-border mb-6 max-h-100 overflow-y-auto rounded-md border p-4",
				children: l && c && c.schema ? /* @__PURE__ */ r(t, {
					form: p,
					schema: c.schema,
					ui: c.ui,
					disabled: !1,
					viewOnly: !1
				}) : /* @__PURE__ */ r("div", {
					className: "flex items-center justify-center py-12",
					children: /* @__PURE__ */ r("p", {
						className: "text-muted-foreground",
						children: "No additional configuration required."
					})
				})
			}),
			/* @__PURE__ */ r("div", {
				className: "flex justify-end",
				children: /* @__PURE__ */ i(e, {
					variant: "default",
					disabled: u,
					onClick: () => h(""),
					size: "lg",
					className: "font-medium",
					children: [u && /* @__PURE__ */ r(a, { className: "h-4 w-4 animate-spin" }), "Run Now"]
				})
			})
		]
	});
};
//#endregion
export { c as default };
