import { __assign, __rest } from "tslib";
import React, { forwardRef } from "react";
import { IconBrokenArrowLeft } from "@greenatom/icons";
import H from "../typography/H";
import Button from "../Button";
import { PageHeaderStyled } from "./styles";
var PageHeader = forwardRef(function (_a, ref) {
    var className = _a.className, trailIcon = _a.trailIcon, isLeadIcon = _a.isLeadIcon, _b = _a.leadIcon, leadIcon = _b === void 0 ? React.createElement(IconBrokenArrowLeft, null) : _b, width = _a.width, style = _a.style, onClickTrail = _a.onClickTrail, text = _a.text, onClickLead = _a.onClickLead, props = __rest(_a, ["className", "trailIcon", "isLeadIcon", "leadIcon", "width", "style", "onClickTrail", "text", "onClickLead"]);
    return (React.createElement(PageHeaderStyled, __assign({ className: className, ref: ref, style: style, width: width }, props),
        isLeadIcon && (React.createElement("button", { className: "page-header_button", onClick: onClickLead }, leadIcon)),
        React.createElement(H, { className: "page-header_text", type: "libra" }, text),
        trailIcon && (React.createElement(Button, { className: "page-header_trail-button", onClick: onClickTrail, viewType: "ghost", size: "s" }, trailIcon))));
});
PageHeader.displayName = "PageHeader";
export default PageHeader;
