"use strict";
exports.__esModule = true;
exports.ContentAnchorCard = exports.cnContentAnchorCard = void 0;
var tslib_1 = require("tslib");
// @ts-nocheck
require("./ContentAnchorCard.css");
var react_1 = (0, tslib_1.__importDefault)(require("react"));
var IconChevronArrowDown_1 = require("../../icons/IconChevronArrowDown/IconChevronArrowDown");
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");
exports.cnContentAnchorCard = (0, bem_1.cn)('ContentAnchorCard');
exports.ContentAnchorCard = (0, PropsWithAsAttributes_1.forwardRefWithAs)(function (props, ref) {
    var _a = (0, usePropsHandler_1.usePropsHandler)((0, exports.cnContentAnchorCard)(), props), icon = _a.icon, title = _a.title, lineColor = _a.lineColor, _b = _a.view, view = _b === void 0 ? 'default' : _b, path = _a.path, onClick = _a.onClick;
    var Component = path ? 'a' : 'button';
    var options = {};
    if (path) {
        options.to = path;
    }
    return (react_1["default"].createElement(Component, (0, tslib_1.__assign)({ className: (0, exports.cnContentAnchorCard)({ view: view }) }, options, { onClick: function () { return onClick(path); } }),
        lineColor && (react_1["default"].createElement("div", { className: (0, exports.cnContentAnchorCard)('Line'), style: { backgroundColor: lineColor } })),
        title && (react_1["default"].createElement(Typography_1.Typography.Title, { size: "md", className: (0, exports.cnContentAnchorCard)('Title') }, title)),
        icon && react_1["default"].createElement(Picture_1.Picture, { desktop: icon, className: (0, exports.cnContentAnchorCard)('Icon') }),
        react_1["default"].createElement(Button_1.Button, { as: "div", view: "ghost", iconRight: IconChevronArrowDown_1.IconChevronArrowDown, iconSize: "xs" })));
});
