"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExpressionFunctionDocumentation = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const Tag_1 = require("../Tag");
const Flex_1 = require("../Flex");
const signatureClassName = 'twa:m-0 twa:whitespace-pre-wrap twa:bg-primary twa:text-text-on-primary twa:rounded-standard twa:p-1 twa:inline-block';
const ExpressionFunctionDocumentation = (props) => {
    return props.expressionFunction ? (React.createElement(Flex_1.Box, { "data-name": "expression-editor-documentation", className: "twa:my-2 twa:p-2 twa:rounded-standard twa:leading-normal" },
        props.expressionFunction.description && (React.createElement(Flex_1.Box, { className: "twa:mb-3 twa:font-bold twa:whitespace-pre-wrap", "data-name": "expression-editor-documentation-description" }, props.expressionFunction.description)),
        props.expressionFunction.signatures && (React.createElement(Flex_1.Box, { "data-name": "expression-editor-documentation-signatures" },
            React.createElement("b", null, "Signatures"),
            React.createElement("ul", { className: "twa:flex twa:flex-col twa:gap-1" }, props.expressionFunction.signatures.map((signature, index) => (React.createElement("li", { key: index },
                React.createElement("pre", { className: signatureClassName }, signature))))))),
        props.expressionFunction.examples && (React.createElement(Flex_1.Box, { "data-name": "expression-editor-documentation-examples" },
            React.createElement("b", null, "Examples"),
            React.createElement("ul", { className: "twa:flex twa:flex-col twa:gap-1" }, props.expressionFunction.examples.map((example, index) => (React.createElement("li", { key: index },
                React.createElement("pre", { className: signatureClassName }, example))))))),
        props.expressionFunction.returnType && (React.createElement(Flex_1.Box, { "data-name": "expression-editor-documentation-examples" },
            React.createElement("b", null, "Return Type"),
            React.createElement(Tag_1.Tag, { className: "twa:bg-accentlight twa:text-accent twa:ml-3 twa:rounded-full twa:py-1" }, props.expressionFunction.returnType))))) : null;
};
exports.ExpressionFunctionDocumentation = ExpressionFunctionDocumentation;
