"use strict";
exports.__esModule = true;
exports.TwitterCard = exports.cnTwitterCard = void 0;
var tslib_1 = require("tslib");
// @ts-nocheck
require("./TwitterCard.css");
var react_1 = (0, tslib_1.__importDefault)(require("react"));
var IconArrowRight_1 = require("../../icons/IconArrowRight/IconArrowRight");
var IconTwitter_1 = require("../../icons/IconTwitter/IconTwitter");
var IconYouTube_1 = require("../../icons/IconYouTube/IconYouTube");
var bem_1 = require("../../utils/bem");
var PropsWithAsAttributes_1 = require("../../utils/types/PropsWithAsAttributes");
var Button_1 = require("../Button/Button");
var usePropsHandler_1 = require("../EventInterceptor/usePropsHandler");
var Typography_1 = require("../Typography/Typography");
var User_1 = require("../User/User");
exports.cnTwitterCard = (0, bem_1.cn)('TwitterCard');
exports.TwitterCard = (0, PropsWithAsAttributes_1.forwardRefWithAs)(function (props, ref) {
    var _a = (0, usePropsHandler_1.usePropsHandler)((0, exports.cnTwitterCard)(), props), firstName = _a.firstName, lastName = _a.lastName, photo = _a.photo, text = _a.text, linkTitle = _a.linkTitle, type = _a.type, linkUrl = _a.linkUrl, targetBlank = _a.targetBlank;
    var buttonIcon;
    if (type === 'twitter') {
        buttonIcon = IconTwitter_1.IconTwitter;
    }
    if (type === 'blog') {
        buttonIcon = IconArrowRight_1.IconArrowRight;
    }
    if (type === 'youtube') {
        buttonIcon = IconYouTube_1.IconYouTube;
    }
    return (react_1["default"].createElement(react_1["default"].Fragment, null,
        react_1["default"].createElement("div", { className: (0, exports.cnTwitterCard)() },
            react_1["default"].createElement(User_1.User, { size: "s", className: (0, exports.cnTwitterCard)('User'), name: "".concat(firstName, " ").concat(lastName), avatarUrl: photo === null || photo === void 0 ? void 0 : photo.desktop2x }),
            react_1["default"].createElement(Typography_1.Typography.Text, { className: (0, exports.cnTwitterCard)('Text') }, text),
            react_1["default"].createElement("div", { className: (0, exports.cnTwitterCard)('Bottom') },
                react_1["default"].createElement(Button_1.Button, { view: "link-secondary", as: "a", href: linkUrl, iconSize: 's', label: linkTitle, iconRight: buttonIcon, target: targetBlank ? '_blank' : null })))));
});
