/**
 * amis-ui v6.12.0-beta.0
 * Copyright 2018-2025 fex
 */

import { __extends } from 'tslib';
import React__default from 'react';
import { themeable } from 'amis-core';

/**
 * @file TitleBar。
 * @description
 * @author fex
 * @param 参数说明：
 * title 标题内容
 * titleClassName 标题类名，默认为 bg-light lter b-b
 * right 可以传入右侧节点, 当有右侧时自动采用 hbox 来左右布局。
 */
var TitleBar = /** @class */ (function (_super) {
    __extends(TitleBar, _super);
    function TitleBar() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    TitleBar.prototype.render = function () {
        var _a = this.props, className = _a.className, title = _a.title, titleClassName = _a.titleClassName, right = _a.right, cx = _a.classnames;
        var left = title ? React__default.createElement("div", { className: titleClassName }, title) : null;
        var body = left;
        if (right) {
            body = (React__default.createElement("div", { className: "hbox hbox-auto-xs h-auto" },
                React__default.createElement("div", { className: "col bg-light b-b wrapper" }, left),
                React__default.createElement("div", { className: "col v-middle padder-md text-right bg-light b-b wrapper-sm" }, right)));
        }
        else {
            body = React__default.createElement("div", { className: "wrapper" }, left);
        }
        return React__default.createElement("div", { className: cx(className, 'TitleBar') }, body);
    };
    TitleBar.defaultProps = {
        className: 'bg-light lter b-b',
        title: '标题',
        titleClassName: 'm-n font-thin h3',
        right: false
    };
    return TitleBar;
}(React__default.PureComponent));
var TitleBar$1 = themeable(TitleBar);

export { TitleBar, TitleBar$1 as default };
