"use strict";
exports.__esModule = true;
exports.CaseCard = exports.cnCaseCard = 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("./CaseCard.css");
var react_1 = (0, tslib_1.__importDefault)(require("react"));
var react_router_dom_1 = require("react-router-dom");
var IconArrowRight_1 = require("../../icons/IconArrowRight/IconArrowRight");
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 Picture_1 = require("../Picture/Picture");
var Typography_1 = require("../Typography/Typography");
// const sizeMap: Record<Props, TitleProps> = {
// };
exports.cnCaseCard = (0, bem_1.cn)('CaseCard');
exports.CaseCard = (0, PropsWithAsAttributes_1.forwardRefWithAs)(function (props, ref) {
    var _a = (0, usePropsHandler_1.usePropsHandler)((0, exports.cnCaseCard)(), props), color = _a.color, hasClient = _a.hasClient, logo = _a.logo, routePath = _a.routePath, shortDescription = _a.shortDescription, title = _a.title, buttonTitle = _a.buttonTitle, _b = _a.buttonIcon, buttonIcon = _b === void 0 ? IconArrowRight_1.IconArrowRight : _b, style = _a.style;
    return (react_1["default"].createElement("div", { className: (0, exports.cnCaseCard)({
            main: !hasClient,
            border: !!color && !hasClient
        }), style: style },
        !hasClient && color && (react_1["default"].createElement("div", { className: (0, exports.cnCaseCard)('Border'), style: { backgroundColor: color } })),
        routePath && react_1["default"].createElement(react_router_dom_1.NavLink, { to: routePath, className: (0, exports.cnCaseCard)('OverlayLink') }),
        !hasClient && (react_1["default"].createElement(Typography_1.Typography.Title, { className: (0, exports.cnCaseCard)('Title'), size: "sm" }, title)),
        hasClient && !!logo && Object.keys(logo).length > 0 && (react_1["default"].createElement(Picture_1.Picture, { className: (0, exports.cnCaseCard)('Logo'), desktop: logo.url, desktopWebp: logo.urlWebp })),
        shortDescription && (react_1["default"].createElement(Typography_1.Typography.Text, { className: (0, exports.cnCaseCard)('Text') }, shortDescription)),
        routePath && (react_1["default"].createElement("div", { className: (0, exports.cnCaseCard)('Bottom') },
            react_1["default"].createElement(Button_1.Button, { view: "link-secondary", iconSize: 'm', label: buttonTitle, iconRight: buttonIcon, isLink: !!routePath, to: routePath }),
            !hasClient && !!logo && Object.keys(logo).length > 0 && (react_1["default"].createElement(Picture_1.Picture, { className: (0, exports.cnCaseCard)('Logo'), desktop: logo.url, desktopWebp: logo.urlWebp }))))));
});
