import { require_enums as e } from "../../../packages/contracts/dist/enums/index.js";
import t from "./DocumentItem.js";
import { useEffect as n } from "react";
import { jsx as r } from "react/jsx-runtime";
import { useParams as i } from "react-router-dom";
//#region src/features/documents/components/DocumentList.tsx
var a = e(), o = ({ workflow: e, childWorkflow: o, documents: s, scrollTo: c, settings: l }) => {
	let { workflowId: u, clickId: d } = i();
	n(() => {
		u === o.id && c(o.id);
	}, [
		o.id,
		u,
		d,
		c
	]);
	let f = o.status === a.WorkflowState.Waiting;
	return /* @__PURE__ */ r("div", {
		className: "flex flex-col gap-3",
		children: s.map((n, i) => {
			let a = n, c = n.place === o.place || !!a.meta?.enableAtPlaces?.includes(o.place);
			return console.log({
				isDocumentActive: c,
				isWorkflowActive: f,
				status: o.status,
				place: o.place,
				documentPlace: n.place,
				availableTransitions: o.availableTransitions
			}), /* @__PURE__ */ r(t, {
				document: n,
				workflow: o,
				parentWorkflow: e,
				isActive: f && c,
				isLastItem: i === s.length - 1,
				settings: l
			}, n.id);
		})
	});
};
//#endregion
export { o as default };
