/* eslint-disable jsx-a11y/anchor-has-content */
/* eslint-disable jsx-a11y/control-has-associated-label */
// @ts-nocheck
import './CaseCard.css';
import React from 'react';
import { NavLink } from 'react-router-dom';
import { IconArrowRight } from '../../icons/IconArrowRight/IconArrowRight';
import { cn } from '../../utils/bem';
import { forwardRefWithAs } from '../../utils/types/PropsWithAsAttributes';
import { Button } from '../Button/Button';
import { usePropsHandler } from '../EventInterceptor/usePropsHandler';
import { Picture } from '../Picture/Picture';
import { Typography } from '../Typography/Typography';
// const sizeMap: Record<Props, TitleProps> = {
// };
export var cnCaseCard = cn('CaseCard');
export var CaseCard = forwardRefWithAs(function (props, ref) {
    var _a = usePropsHandler(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 : _b, style = _a.style;
    return (React.createElement("div", { className: cnCaseCard({
            main: !hasClient,
            border: !!color && !hasClient
        }), style: style },
        !hasClient && color && (React.createElement("div", { className: cnCaseCard('Border'), style: { backgroundColor: color } })),
        routePath && React.createElement(NavLink, { to: routePath, className: cnCaseCard('OverlayLink') }),
        !hasClient && (React.createElement(Typography.Title, { className: cnCaseCard('Title'), size: "sm" }, title)),
        hasClient && !!logo && Object.keys(logo).length > 0 && (React.createElement(Picture, { className: cnCaseCard('Logo'), desktop: logo.url, desktopWebp: logo.urlWebp })),
        shortDescription && (React.createElement(Typography.Text, { className: cnCaseCard('Text') }, shortDescription)),
        routePath && (React.createElement("div", { className: cnCaseCard('Bottom') },
            React.createElement(Button, { view: "link-secondary", iconSize: 'm', label: buttonTitle, iconRight: buttonIcon, isLink: !!routePath, to: routePath }),
            !hasClient && !!logo && Object.keys(logo).length > 0 && (React.createElement(Picture, { className: cnCaseCard('Logo'), desktop: logo.url, desktopWebp: logo.urlWebp }))))));
});
