import { __assign, __rest } from "tslib";
/* eslint-disable jsx-a11y/anchor-has-content */
/* eslint-disable jsx-a11y/control-has-associated-label */
// @ts-nocheck
import './PartnerCard.css';
import React from 'react';
import { IconOpenInNew } from '../../icons/IconOpenInNew/IconOpenInNew';
import { cn } from '../../utils/bem';
import { forwardRefWithAs } from '../../utils/types/PropsWithAsAttributes';
import { Article } from '../Article/Article';
import { Button } from '../Button/Button';
import { usePropsHandler } from '../EventInterceptor/usePropsHandler';
import { Picture } from '../Picture/Picture';
import { Typography } from '../Typography/Typography';
export var cnPartnerCard = cn('PartnerCard');
export var PartnerCard = forwardRefWithAs(function (props) {
    var _a = usePropsHandler(cnPartnerCard(), props), title = _a.title, text = _a.text, _b = _a.view, view = _b === void 0 ? 'default' : _b, color = _a.color, picture = _a.picture, link = _a.link, otherProps = __rest(_a, ["title", "text", "view", "color", "picture", "link"]);
    return (React.createElement("div", __assign({ className: cnPartnerCard({ view: view }) }, otherProps),
        color && React.createElement("div", { className: cnPartnerCard('Line'), style: { backgroundColor: color } }),
        link && (React.createElement("a", { href: link.link, target: link.targetBlank ? '_blank' : null, rel: "noreferrer noopener", className: cnPartnerCard('Link') })),
        picture && React.createElement(Picture, __assign({}, picture, { className: cnPartnerCard('Photo') })),
        title && (React.createElement(Typography.Text, { weight: "bold", className: cnPartnerCard('Title') }, title)),
        text && React.createElement(Article, { className: cnPartnerCard('Text'), content: text }),
        link && (React.createElement("div", { className: cnPartnerCard('Button') },
            React.createElement(Button, { view: "link-secondary", iconRight: IconOpenInNew, as: "a", iconSize: "xs", href: link.link, label: link.title, target: link.targetBlank ? '_blank' : null, rel: "noreferrer noopener" })))));
});
