"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FormattingTitle = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const Flex_1 = require("nice-ui/lib/3-list-item/Flex");
const nano_theme_1 = require("nano-theme");
const blockClass = (0, nano_theme_1.rule)({
    d: 'flex',
    ai: 'center',
    fz: '14px',
    us: 'none',
});
const iconClass = (0, nano_theme_1.rule)({
    fz: '15.7px',
    w: '30px',
    h: '30px',
    bdrad: '6px',
    pd: '0',
    mr: '1px 9px 1px 1px',
    d: 'flex',
    ai: 'center',
    jc: 'center',
    bg: 'rgba(0,0,0,.08)',
    o: 0.7,
    '&>div': {
        transform: 'scale(.9)',
        transformOrigin: 'center',
        d: 'flex',
        ai: 'center',
        jc: 'center',
    },
});
const FormattingTitle = ({ formatting }) => {
    const behavior = formatting.behavior;
    const menu = behavior.data().menu;
    const icon = menu?.icon?.();
    const name = menu?.name ?? behavior.name;
    return (React.createElement("div", { className: blockClass }, icon ? (React.createElement(Flex_1.Flex, { style: { alignItems: 'center' } },
        React.createElement("div", { className: iconClass },
            React.createElement("div", null, icon)),
        name)) : (name)));
};
exports.FormattingTitle = FormattingTitle;
//# sourceMappingURL=FormattingTitle.js.map