"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BannerCard = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const components_1 = require("../../components/index.js");
const theme_1 = require("../../gravity-blocks/context/theme/index.js");
const utils_1 = require("../../utils/index.js");
const b = (0, utils_1.block)('banner-card');
const BannerCard = (props) => {
    const { title, subtitle, button, color, theme: textTheme = 'light', image, disableCompress, mediaView = 'full', } = props;
    const theme = (0, theme_1.useTheme)();
    const contentStyle = {};
    const { url, text, target, theme: buttonTheme = 'raised' } = button || {};
    if (color) {
        contentStyle.backgroundColor = (0, utils_1.getThemedValue)(color, theme);
    }
    return ((0, jsx_runtime_1.jsx)("div", { className: b({ theme: textTheme, ['media-view']: mediaView }), children: (0, jsx_runtime_1.jsxs)("div", { className: b('content'), style: contentStyle, children: [(0, jsx_runtime_1.jsxs)("div", { className: b('info'), children: [(0, jsx_runtime_1.jsxs)("div", { className: b('text'), children: [(0, jsx_runtime_1.jsx)(components_1.YFMWrapper, { tagName: "h2", contentClassName: b('title'), content: title, modifiers: {
                                        constructor: true,
                                    } }), subtitle && ((0, jsx_runtime_1.jsx)(components_1.YFMWrapper, { contentClassName: b('subtitle'), content: subtitle, modifiers: { constructor: true } }))] }), url && ((0, jsx_runtime_1.jsx)(components_1.RouterLink, { href: url, children: (0, jsx_runtime_1.jsx)(components_1.Button, { className: b('button'), theme: buttonTheme, size: "xl", text: text ?? '', url: url, target: target }) }))] }), (0, jsx_runtime_1.jsx)(components_1.BackgroundImage, { className: b('image'), src: (0, utils_1.getThemedValue)(image, theme), disableCompress: disableCompress })] }) }));
};
exports.BannerCard = BannerCard;
exports.default = exports.BannerCard;
//# sourceMappingURL=BannerCard.js.map
