import { __assign, __rest } from "tslib";
// @ts-nocheck
/* eslint-disable jsx-a11y/anchor-has-content */
import './Banner.css';
import React from 'react';
import { forwardRefWithAs } from '../../utils/types/PropsWithAsAttributes';
import { cn } from '../../utils/bem';
import { Typography } from '../Typography';
import { Button } from '../Button/Button';
import { Picture } from '../Picture/Picture';
import { IconArrowRight } from '../../icons/IconArrowRight/IconArrowRight';
export var bannerPropView = ['glassdoor', 'vacancy', 'section'];
export var bannerPropViewDefault = bannerPropView[0];
var cnBanner = cn('Banner');
export var Banner = forwardRefWithAs(function (props, ref) {
    var _a = props.view, view = _a === void 0 ? bannerPropViewDefault : _a, title = props.title, titleSize = props.titleSize, labelButton = props.labelButton, text = props.text, picture = props.picture, _b = props.buttonIcon, buttonIcon = _b === void 0 ? IconArrowRight : _b, _c = props.buttonIconSize, buttonIconSize = _c === void 0 ? 'm' : _c, buttonAttrs = props.buttonAttrs, onClick = props.onClick, bgColor = props.bgColor, inverted = props.inverted, className = props.className, labelButtonSecondary = props.labelButtonSecondary, onClickSecondary = props.onClickSecondary, buttonAttrsSecondary = props.buttonAttrsSecondary, leftColor = props.leftColor, rightColor = props.rightColor, subtitle = props.subtitle, targetBlank = props.targetBlank, link = props.link, otherProps = __rest(props, ["view", "title", "titleSize", "labelButton", "text", "picture", "buttonIcon", "buttonIconSize", "buttonAttrs", "onClick", "bgColor", "inverted", "className", "labelButtonSecondary", "onClickSecondary", "buttonAttrsSecondary", "leftColor", "rightColor", "subtitle", "targetBlank", "link"]);
    return (React.createElement("div", __assign({ className: cnBanner({ view: view, inverted: inverted }, [className]), style: { backgroundColor: bgColor } }, otherProps),
        view === 'case' ? (targetBlank ? (React.createElement("a", { href: link, target: "_blank", rel: "noreferrer noopener", className: cnBanner('Link') })) : null) : null,
        React.createElement("div", { className: cnBanner('Inner') },
            React.createElement(Typography.Text, { className: cnBanner('SubTitle'), size: "xs", weight: "bold", transform: "uppercase" }, subtitle),
            React.createElement(Typography.Title, { className: cnBanner('Title'), size: titleSize }, title),
            text && (React.createElement(Typography.Text, { className: cnBanner('Text') }, text)),
            labelButton && (React.createElement("div", { className: cnBanner('Button') },
                React.createElement(Button, __assign({ view: "link-secondary", iconRight: buttonIcon, iconSize: buttonIconSize, label: labelButton, onClick: onClick, inverted: inverted }, buttonAttrs)))),
            labelButtonSecondary && (React.createElement("div", { className: cnBanner('SecondaryButton') },
                React.createElement(Button, __assign({ view: "link-secondary", iconRight: buttonIcon, iconSize: buttonIconSize, label: labelButtonSecondary, onClick: onClickSecondary, inverted: inverted }, buttonAttrsSecondary))))),
        picture && (React.createElement("div", { className: cnBanner('Picture') },
            React.createElement(Picture, __assign({}, picture))))));
});
