import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useTheme } from "../../gravity-blocks/context/theme/index.js";
import { Col, Grid, Row } from "../../gravity-blocks/grid/index.js";
import Content from "../../sub-blocks/Content/Content.js";
import { block, getThemedValue } from "../../utils/index.js";
import './Info.css';
const b = block('info-block');
const sizes = { md: 6, all: 12 };
export const InfoBlock = (props) => {
    const { backgroundColor, theme: blockTheme = 'dark', buttons = [], title, sectionsTitle, links = [], rightContent = {}, leftContent = {}, } = props;
    const theme = 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 (_jsx(Grid, { children: _jsx("div", { className: b(), children: _jsx("div", { className: b('container'), style: { backgroundColor: getThemedValue(backgroundColor, theme) }, children: _jsxs(Row, { children: [_jsx(Col, { sizes: sizes, className: b('left'), children: _jsx(Content, { title: title || leftContent?.title, text: leftContent?.text, links: leftContent?.links, list: leftContent?.list, buttons: leftButtons, additionalInfo: leftContent?.additionalInfo, ...commonProps }) }), _jsx(Col, { sizes: sizes, className: b('right'), children: _jsx(Content, { title: sectionsTitle || rightContent?.title, text: rightContent?.text, links: rightLinks, list: rightContent?.list, buttons: rightContent?.buttons, additionalInfo: rightContent?.additionalInfo, ...commonProps }) })] }) }) }) }));
};
export default InfoBlock;
//# sourceMappingURL=Info.js.map
