"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Title = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const OverflowTypography_1 = require("../../../OverflowTypography");
const Skeleton_1 = require("../../../Skeleton");
const styles_1 = require("./styles");
const Title = ({ title, isLoading, children }) => {
    if (!title && !children && isLoading) {
        return (0, jsx_runtime_1.jsx)(Skeleton_1.Skeleton, { height: 20, width: 200 });
    }
    if (typeof title === 'string') {
        return ((0, jsx_runtime_1.jsxs)(styles_1.TitleWrapper, { component: "h3", variant: "h5", children: [(0, jsx_runtime_1.jsx)(OverflowTypography_1.OverflowTypography, { component: "div", variant: "inherit", children: title }), children] }));
    }
    return ((0, jsx_runtime_1.jsxs)(styles_1.TitleWrapper, { component: "div", role: "heading", "aria-level": 3, variant: "h5", children: [title, children] }));
};
exports.Title = Title;
