import UiActions_default from "../../../components/ui-widgets/UiActions.js";
import { c } from "react/compiler-runtime";
import React from "react";
import { WorkflowState } from "@loopstack/api-client";
import { jsx } from "react/jsx-runtime";
var WorkflowForms_default = (a) => {
	let o = c(7), { workflow: s, onSubmit: l } = a, u = s.ui?.actions;
	if (!u?.length) return null;
	let d;
	o[0] === s.availableTransitions ? d = o[1] : (d = s.availableTransitions?.map(_temp) ?? [], o[0] = s.availableTransitions, o[1] = d);
	let f = d, p = u, m = s.status === WorkflowState.Completed, h;
	return o[2] !== f || o[3] !== l || o[4] !== p || o[5] !== m ? (h = /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(UiActions_default, {
		actions: p,
		availableTransitions: f,
		disabled: m,
		onSubmit: l
	}) }), o[2] = f, o[3] = l, o[4] = p, o[5] = m, o[6] = h) : h = o[6], h;
};
function _temp(e) {
	return e.id;
}
export { WorkflowForms_default as default };
