"use strict";
exports.__esModule = true;
exports.ValuesCard = exports.cnValuesCard = exports.cardPropSizeDefault = exports.cardPropSize = void 0;
var tslib_1 = require("tslib");
// @ts-nocheck
require("./ValuesCard.css");
var react_1 = (0, tslib_1.__importDefault)(require("react"));
var bem_1 = require("../../utils/bem");
var getSizeByMap_1 = require("../../utils/getSizeByMap");
var PropsWithAsAttributes_1 = require("../../utils/types/PropsWithAsAttributes");
var Article_1 = require("../Article/Article");
var usePropsHandler_1 = require("../EventInterceptor/usePropsHandler");
var Picture_1 = require("../Picture/Picture");
var Typography_1 = require("../Typography/Typography");
exports.cardPropSize = ['s', 'm'];
exports.cardPropSizeDefault = exports.cardPropSize[0];
exports.cnValuesCard = (0, bem_1.cn)('ValuesCard');
var sizeMapTitle = {
    s: 'tiny',
    m: 'sm',
    l: 'md'
};
exports.ValuesCard = (0, PropsWithAsAttributes_1.forwardRefWithAs)(function (props, ref) {
    var _a = (0, usePropsHandler_1.usePropsHandler)((0, exports.cnValuesCard)(), props), view = _a.view, color = _a.color, picture = _a.picture, text = _a.text, title = _a.title, _b = _a.size, size = _b === void 0 ? exports.cardPropSizeDefault : _b, renderContent = _a.renderContent, number = _a.number, subtitle = _a.subtitle;
    return (react_1["default"].createElement("div", { className: (0, exports.cnValuesCard)({ size: size, view: view, number: !!number }) },
        number && (react_1["default"].createElement(Typography_1.Typography.Text, { size: "xs", weight: "bold", transform: "uppercase", className: (0, exports.cnValuesCard)('Number') }, number)),
        color && react_1["default"].createElement("div", { className: (0, exports.cnValuesCard)('Border'), style: { backgroundColor: color } }),
        picture && (react_1["default"].createElement(Picture_1.Picture, { desktop: picture.url, desktopWebp: picture.urlWebp, className: (0, exports.cnValuesCard)('Picture') })),
        title && (react_1["default"].createElement(Typography_1.Typography.Title, { size: (0, getSizeByMap_1.getSizeByMap)(sizeMapTitle, size), className: (0, exports.cnValuesCard)('Title'), dangerouslySetInnerHTML: { __html: title } })),
        subtitle && (react_1["default"].createElement(Typography_1.Typography.Text, { weight: "bold", className: (0, exports.cnValuesCard)('SubTitle'), dangerouslySetInnerHTML: { __html: subtitle } })),
        text && react_1["default"].createElement(Article_1.Article, { className: (0, exports.cnValuesCard)('Text'), content: text }),
        renderContent && react_1["default"].createElement("div", { className: (0, exports.cnValuesCard)('Content') }, renderContent)));
});
