"use strict";
exports.__esModule = true;
exports.PartnerCard = exports.cnPartnerCard = void 0;
var tslib_1 = require("tslib");
/* eslint-disable jsx-a11y/anchor-has-content */
/* eslint-disable jsx-a11y/control-has-associated-label */
// @ts-nocheck
require("./PartnerCard.css");
var react_1 = (0, tslib_1.__importDefault)(require("react"));
var IconOpenInNew_1 = require("../../icons/IconOpenInNew/IconOpenInNew");
var bem_1 = require("../../utils/bem");
var PropsWithAsAttributes_1 = require("../../utils/types/PropsWithAsAttributes");
var Article_1 = require("../Article/Article");
var Button_1 = require("../Button/Button");
var usePropsHandler_1 = require("../EventInterceptor/usePropsHandler");
var Picture_1 = require("../Picture/Picture");
var Typography_1 = require("../Typography/Typography");
exports.cnPartnerCard = (0, bem_1.cn)('PartnerCard');
exports.PartnerCard = (0, PropsWithAsAttributes_1.forwardRefWithAs)(function (props) {
    var _a = (0, usePropsHandler_1.usePropsHandler)((0, exports.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 = (0, tslib_1.__rest)(_a, ["title", "text", "view", "color", "picture", "link"]);
    return (react_1["default"].createElement("div", (0, tslib_1.__assign)({ className: (0, exports.cnPartnerCard)({ view: view }) }, otherProps),
        color && react_1["default"].createElement("div", { className: (0, exports.cnPartnerCard)('Line'), style: { backgroundColor: color } }),
        link && (react_1["default"].createElement("a", { href: link.link, target: link.targetBlank ? '_blank' : null, rel: "noreferrer noopener", className: (0, exports.cnPartnerCard)('Link') })),
        picture && react_1["default"].createElement(Picture_1.Picture, (0, tslib_1.__assign)({}, picture, { className: (0, exports.cnPartnerCard)('Photo') })),
        title && (react_1["default"].createElement(Typography_1.Typography.Text, { weight: "bold", className: (0, exports.cnPartnerCard)('Title') }, title)),
        text && react_1["default"].createElement(Article_1.Article, { className: (0, exports.cnPartnerCard)('Text'), content: text }),
        link && (react_1["default"].createElement("div", { className: (0, exports.cnPartnerCard)('Button') },
            react_1["default"].createElement(Button_1.Button, { view: "link-secondary", iconRight: IconOpenInNew_1.IconOpenInNew, as: "a", iconSize: "xs", href: link.link, label: link.title, target: link.targetBlank ? '_blank' : null, rel: "noreferrer noopener" })))));
});
