"use strict";
/**
 * @file TitleBar。
 * @description
 * @author fex
 * @param 参数说明：
 * title 标题内容
 * titleClassName 标题类名，默认为 bg-light lter b-b
 * right 可以传入右侧节点, 当有右侧时自动采用 hbox 来左右布局。
 */
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = require("react");
var theme_1 = require("../theme");
var TitleBar = /** @class */ (function (_super) {
    tslib_1.__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;
        var left = title ? React.createElement("div", { className: titleClassName }, title) : null;
        var body = left;
        if (right) {
            body = (React.createElement("div", { className: "hbox hbox-auto-xs h-auto" },
                React.createElement("div", { className: "col bg-light b-b wrapper" }, left),
                React.createElement("div", { className: "col v-middle padder-md text-right bg-light b-b wrapper-sm" }, right)));
        }
        else {
            body = React.createElement("div", { className: "wrapper" }, left);
        }
        return React.createElement("div", { className: className }, body);
    };
    TitleBar.defaultProps = {
        className: 'bg-light lter b-b',
        title: '标题',
        titleClassName: 'm-n font-thin h3',
        right: false,
    };
    return TitleBar;
}(React.PureComponent));
exports.TitleBar = TitleBar;
exports.default = theme_1.themeable(TitleBar);
//# sourceMappingURL=./components/TitleBar.js.map
