"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InfoBlock = void 0;
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const theme_1 = require("../../gravity-blocks/context/theme/index.js");
const grid_1 = require("../../gravity-blocks/grid/index.js");
const Content_1 = tslib_1.__importDefault(require("../../sub-blocks/Content/Content.js"));
const utils_1 = require("../../utils/index.js");
const b = (0, utils_1.block)('info-block');
const sizes = { md: 6, all: 12 };
const InfoBlock = (props) => {
    const { backgroundColor, theme: blockTheme = 'dark', buttons = [], title, sectionsTitle, links = [], rightContent = {}, leftContent = {}, } = props;
    const theme = (0, theme_1.useTheme)();
    const contentTheme = blockTheme === 'dark' ? 'dark' : 'default';
    const rightLinks = [
        ...(rightContent?.links || []),
        ...links.map((link) => ({
            ...link,
            arrow: true,
            theme: 'normal',
        })),
    ];
    const leftButtons = [...buttons, ...(leftContent?.buttons || [])];
    const commonProps = {
        colSizes: { all: 12, md: 12 },
        className: b('content'),
        theme: contentTheme,
    };
    return ((0, jsx_runtime_1.jsx)(grid_1.Grid, { children: (0, jsx_runtime_1.jsx)("div", { className: b(), children: (0, jsx_runtime_1.jsx)("div", { className: b('container'), style: { backgroundColor: (0, utils_1.getThemedValue)(backgroundColor, theme) }, children: (0, jsx_runtime_1.jsxs)(grid_1.Row, { children: [(0, jsx_runtime_1.jsx)(grid_1.Col, { sizes: sizes, className: b('left'), children: (0, jsx_runtime_1.jsx)(Content_1.default, { title: title || leftContent?.title, text: leftContent?.text, links: leftContent?.links, list: leftContent?.list, buttons: leftButtons, additionalInfo: leftContent?.additionalInfo, ...commonProps }) }), (0, jsx_runtime_1.jsx)(grid_1.Col, { sizes: sizes, className: b('right'), children: (0, jsx_runtime_1.jsx)(Content_1.default, { title: sectionsTitle || rightContent?.title, text: rightContent?.text, links: rightLinks, list: rightContent?.list, buttons: rightContent?.buttons, additionalInfo: rightContent?.additionalInfo, ...commonProps }) })] }) }) }) }));
};
exports.InfoBlock = InfoBlock;
exports.default = exports.InfoBlock;
//# sourceMappingURL=Info.js.map
