(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define(["require", "exports", "tslib", "react", "@greenatom/icons", "../typography/H", "../Button", "./styles"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = require("tslib");
    var react_1 = (0, tslib_1.__importStar)(require("react"));
    var icons_1 = require("@greenatom/icons");
    var H_1 = (0, tslib_1.__importDefault)(require("../typography/H"));
    var Button_1 = (0, tslib_1.__importDefault)(require("../Button"));
    var styles_1 = require("./styles");
    var PageHeader = (0, react_1.forwardRef)(function (_a, ref) {
        var className = _a.className, trailIcon = _a.trailIcon, isLeadIcon = _a.isLeadIcon, _b = _a.leadIcon, leadIcon = _b === void 0 ? react_1.default.createElement(icons_1.IconBrokenArrowLeft, null) : _b, width = _a.width, style = _a.style, onClickTrail = _a.onClickTrail, text = _a.text, onClickLead = _a.onClickLead, props = (0, tslib_1.__rest)(_a, ["className", "trailIcon", "isLeadIcon", "leadIcon", "width", "style", "onClickTrail", "text", "onClickLead"]);
        return (react_1.default.createElement(styles_1.PageHeaderStyled, (0, tslib_1.__assign)({ className: className, ref: ref, style: style, width: width }, props),
            isLeadIcon && (react_1.default.createElement("button", { className: "page-header_button", onClick: onClickLead }, leadIcon)),
            react_1.default.createElement(H_1.default, { className: "page-header_text", type: "libra" }, text),
            trailIcon && (react_1.default.createElement(Button_1.default, { className: "page-header_trail-button", onClick: onClickTrail, viewType: "ghost", size: "s" }, trailIcon))));
    });
    PageHeader.displayName = "PageHeader";
    exports.default = PageHeader;
});
