import { ConfigProvider } from "antd";
import classNames from "clsx";
import React, { useContext } from "react";
import { useStyle } from "./style";
/**
 * Mermaid 源码预览组件
 * 在加载 / 未闭合 / 等待渲染等阶段展示原始 Mermaid 代码
 */ export var MermaidCodePreview = function MermaidCodePreview(props) {
    var context = useContext(ConfigProvider.ConfigContext);
    var baseCls = (context === null || context === void 0 ? void 0 : context.getPrefixCls('agentic-plugin-mermaid')) || 'agentic-plugin-mermaid';
    var _useStyle = useStyle(baseCls), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
    return wrapSSR(/*#__PURE__*/ React.createElement("div", {
        className: classNames(baseCls, hashId),
        contentEditable: false
    }, /*#__PURE__*/ React.createElement("div", {
        className: classNames("".concat(baseCls, "-empty"), hashId)
    }, /*#__PURE__*/ React.createElement("pre", {
        style: {
            margin: 0,
            whiteSpace: 'pre-wrap',
            wordBreak: 'break-word'
        }
    }, props.code))));
};
