import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
// (C) 2022-2026 GoodData Corporation
import { useMemo } from "react";
import { EmbedInsightCodeArea } from "./CodeArea.js";
import { PrepareEnvMessage } from "./PrepareEnvMessage.js";
import { ReactOptions } from "./ReactOptions.js";
import { WebComponentsOptions } from "./WebComponentsOptions.js";
/**
 * @internal
 */
export function EmbedInsightContent({ integrationDocLink, embedTypeOptions, code, openSaveInsightDialog, onCopyCode, onOptionsChange, }) {
    const renderEmbedOptions = useMemo(() => {
        return embedTypeOptions.type === "react" ? (_jsx(ReactOptions, { option: embedTypeOptions, onChange: onOptionsChange })) : (_jsx(WebComponentsOptions, { option: embedTypeOptions, onChange: onOptionsChange }));
    }, [embedTypeOptions, onOptionsChange]);
    return (_jsxs("div", { className: "embed-insight-dialog-content", children: [
            _jsx(PrepareEnvMessage, { integrationDocLink: integrationDocLink }), _jsxs("div", { className: "embed-insight-dialog-code", children: [
                    _jsx("div", { className: "embed-insight-dialog-code-settings", children: renderEmbedOptions }), _jsx("div", { className: "embed-insight-dialog-code-wrapper", children: _jsx(EmbedInsightCodeArea, { code: code, componentType: embedTypeOptions?.componentType, onCopyCode: onCopyCode, embedType: embedTypeOptions.type, openSaveInsightDialog: openSaveInsightDialog }) })
                ] })
        ] }));
}
