// @ts-nocheck
import './ValuesCard.css';
import React from 'react';
import { cn } from '../../utils/bem';
import { getSizeByMap } from '../../utils/getSizeByMap';
import { forwardRefWithAs } from '../../utils/types/PropsWithAsAttributes';
import { Article } from '../Article/Article';
import { usePropsHandler } from '../EventInterceptor/usePropsHandler';
import { Picture } from '../Picture/Picture';
import { Typography } from '../Typography/Typography';
export var cardPropSize = ['s', 'm'];
export var cardPropSizeDefault = cardPropSize[0];
export var cnValuesCard = cn('ValuesCard');
var sizeMapTitle = {
    s: 'tiny',
    m: 'sm',
    l: 'md'
};
export var ValuesCard = forwardRefWithAs(function (props, ref) {
    var _a = usePropsHandler(cnValuesCard(), props), view = _a.view, color = _a.color, picture = _a.picture, text = _a.text, title = _a.title, _b = _a.size, size = _b === void 0 ? cardPropSizeDefault : _b, renderContent = _a.renderContent, number = _a.number, subtitle = _a.subtitle;
    return (React.createElement("div", { className: cnValuesCard({ size: size, view: view, number: !!number }) },
        number && (React.createElement(Typography.Text, { size: "xs", weight: "bold", transform: "uppercase", className: cnValuesCard('Number') }, number)),
        color && React.createElement("div", { className: cnValuesCard('Border'), style: { backgroundColor: color } }),
        picture && (React.createElement(Picture, { desktop: picture.url, desktopWebp: picture.urlWebp, className: cnValuesCard('Picture') })),
        title && (React.createElement(Typography.Title, { size: getSizeByMap(sizeMapTitle, size), className: cnValuesCard('Title'), dangerouslySetInnerHTML: { __html: title } })),
        subtitle && (React.createElement(Typography.Text, { weight: "bold", className: cnValuesCard('SubTitle'), dangerouslySetInnerHTML: { __html: subtitle } })),
        text && React.createElement(Article, { className: cnValuesCard('Text'), content: text }),
        renderContent && React.createElement("div", { className: cnValuesCard('Content') }, renderContent)));
});
