import classNames from 'classnames';
import React from 'react';
import { getAttribute } from '../../dom-utils';
// eslint-disable-next-line prefer-arrow-callback
export default React.memo(function Formula({ element, className }) {
    var _a, _b;
    const svg = getAttribute(element, 'svg');
    const textContent = (_a = element.textContent) === null || _a === void 0 ? void 0 : _a.trim();
    const assistiveTitle = (_b = (getAttribute(element, 'assistive-title') || textContent)) !== null && _b !== void 0 ? _b : '';
    const isDisplayFormula = getAttribute(element, 'mode') === 'display';
    return (React.createElement(React.Fragment, null,
        React.createElement("span", { className: classNames('e-formula', { 'e-block e-text-center': isDisplayFormula }, className), dangerouslySetInnerHTML: { __html: svg }, "aria-hidden": "true" }),
        React.createElement("span", { className: "e-screen-reader-only" }, assistiveTitle)));
});
//# sourceMappingURL=Formula.js.map