import { Button as e } from "../../../components/ui/button.js";
import t from "../../../components/messages/CompletionMessagePaper.js";
import n from "../../../components/dynamic-form/MarkdownContent.js";
import { useDocumentTransition as r } from "./useDocumentTransition.js";
import "react";
import { jsx as i, jsxs as a } from "react/jsx-runtime";
import { Loader2 as o } from "lucide-react";
//#region src/features/documents/renderers/ConfirmPromptRenderer.tsx
var s = ({ parentWorkflow: s, workflow: c, document: l, isActive: u }) => {
	let d = l.content, { submit: f, canSubmit: p, isLoading: m } = r(s, c, l.ui), h = !!d.answer, g = !u || !p || h, _ = (e) => {
		f({ answer: e });
	};
	return /* @__PURE__ */ i(t, {
		role: "document",
		fullWidth: !0,
		timestamp: new Date(l.createdAt),
		children: /* @__PURE__ */ a("div", {
			className: "flex flex-col gap-4 p-1",
			children: [/* @__PURE__ */ i(n, { content: d.question }), h ? /* @__PURE__ */ a("div", {
				className: "text-muted-foreground text-sm",
				children: ["Answered: ", /* @__PURE__ */ i("span", {
					className: "text-foreground font-medium",
					children: d.answer === "yes" ? "Yes" : "No"
				})]
			}) : /* @__PURE__ */ a("div", {
				className: "flex justify-end gap-3",
				children: [/* @__PURE__ */ a(e, {
					type: "button",
					variant: "outline",
					disabled: g || m,
					onClick: () => _("no"),
					className: "w-32",
					children: [m && /* @__PURE__ */ i(o, { className: "h-4 w-4 animate-spin" }), "No"]
				}), /* @__PURE__ */ a(e, {
					type: "button",
					variant: "default",
					disabled: g || m,
					onClick: () => _("yes"),
					className: "w-32",
					children: [m && /* @__PURE__ */ i(o, { className: "h-4 w-4 animate-spin" }), "Yes"]
				})]
			})]
		})
	});
};
//#endregion
export { s as default };
