import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Col } from "../../gravity-blocks/grid/index.js";
import { block } from "../../utils/index.js";
import YFMWrapper from "../YFMWrapper/YFMWrapper.js";
import TitleItem from "./TitleItem.js";
import './Title.css';
const b = 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 (_jsxs("div", { className: b(null, className), id: id, children: [text && (_jsx(Col, { reset: true, sizes: colSizes, ...(colJustifyContent && { justifyContent: colJustifyContent }), children: _jsx(TitleItem, { text: text, ...titleProps }) })), subtitle && (_jsx(Col, { reset: true, sizes: colSizes, ...(colJustifyContent && { justifyContent: colJustifyContent }), children: _jsx("div", { className: b('description', { titleSize: titleProps?.textSize }), children: _jsx(YFMWrapper, { content: subtitle, modifiers: { constructor: true } }) }) }))] }));
};
export default Title;
//# sourceMappingURL=Title.js.map
