"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const grid_1 = require("../../gravity-blocks/grid/index.js");
const utils_1 = require("../../utils/index.js");
const YFMWrapper_1 = tslib_1.__importDefault(require("../YFMWrapper/YFMWrapper.js"));
const TitleItem_1 = tslib_1.__importDefault(require("./TitleItem.js"));
const b = (0, utils_1.block)('title');
const Title = ({ title, subtitle, className, colSizes = { all: 12, sm: 8 }, colJustifyContent, id, }) => {
    if (!title && !subtitle) {
        return null;
    }
    const { text, ...titleProps } = !title || typeof title === 'string' ? { text: title } : title;
    return ((0, jsx_runtime_1.jsxs)("div", { className: b(null, className), id: id, children: [text && ((0, jsx_runtime_1.jsx)(grid_1.Col, { reset: true, sizes: colSizes, ...(colJustifyContent && { justifyContent: colJustifyContent }), children: (0, jsx_runtime_1.jsx)(TitleItem_1.default, { text: text, ...titleProps }) })), subtitle && ((0, jsx_runtime_1.jsx)(grid_1.Col, { reset: true, sizes: colSizes, ...(colJustifyContent && { justifyContent: colJustifyContent }), children: (0, jsx_runtime_1.jsx)("div", { className: b('description', { titleSize: titleProps?.textSize }), children: (0, jsx_runtime_1.jsx)(YFMWrapper_1.default, { content: subtitle, modifiers: { constructor: true } }) }) }))] }));
};
exports.default = Title;
//# sourceMappingURL=Title.js.map
