import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { cn } from "../../lib/utils";
import { QuestionnaireInline } from "./dialogs/QuestionnaireInline";
export const AgentInlineDialogContent = ({ activeInlineDialog, setActiveInlineDialog, containerRef, displayMode, questionnaireFooterActions, dialogRegistration, onInteractionSubmitted, }) => {
    if (!activeInlineDialog)
        return null;
    if (activeInlineDialog.request.dialogType === "questionnaire") {
        return (_jsx("div", { ref: containerRef, className: cn("agent-inline-dialog min-h-0 overflow-hidden", displayMode === "full" && "h-full"), children: _jsx(QuestionnaireInline, { requestId: activeInlineDialog.request.callbackId, agentId: activeInlineDialog.request.agentId, title: activeInlineDialog.request.title, description: activeInlineDialog.request.description, parameters: activeInlineDialog.request.parameters, footerActions: questionnaireFooterActions, onClose: (result) => {
                    activeInlineDialog.onComplete(result);
                    setActiveInlineDialog(null);
                    void onInteractionSubmitted?.();
                }, onCancel: () => {
                    activeInlineDialog.onCancel();
                    setActiveInlineDialog(null);
                } }) }));
    }
    if (dialogRegistration) {
        const DialogComponent = dialogRegistration.component;
        return (_jsx("div", { className: "agent-inline-dialog", children: _jsx(DialogComponent, { title: activeInlineDialog.request.title, description: activeInlineDialog.request.description, parameters: activeInlineDialog.request.parameters, onClose: (result) => {
                    activeInlineDialog.onComplete(result);
                    setActiveInlineDialog(null);
                    if (activeInlineDialog.request.dialogType === "questionnaire") {
                        void onInteractionSubmitted?.();
                    }
                }, onCancel: () => {
                    activeInlineDialog.onCancel();
                    setActiveInlineDialog(null);
                } }) }));
    }
    return (_jsx("div", { className: "agent-inline-dialog", children: _jsxs("div", { className: "p-4 text-sm text-red-500", children: ["Unknown dialog type: ", activeInlineDialog.request.dialogType] }) }));
};
//# sourceMappingURL=AgentInlineDialogContent.js.map