import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
// (C) 2021-2025 GoodData Corporation
import { insightTitle, widgetTitle } from "@gooddata/sdk-model";
import { Typography } from "@gooddata/sdk-ui-kit";
function OriginalInsightTitle({ title }) {
    return (_jsx(Typography, { tagName: "p", className: "insight-title s-insight-title ", children: _jsx("span", { className: "original-insight-title", children: title }) }));
}
/**
 * @internal
 */
export function DefaultDashboardInsightMenuTitle(props) {
    const { widget, insight, renderMode } = props;
    const title = widgetTitle(widget);
    const originalTitle = insight ? insightTitle(insight) : title;
    const titlesDiffer = title !== originalTitle;
    const renderedTitle = title ? (_jsx("span", { className: "insight-title s-insight-title s-insight-title-simple", children: props.widget.title })) : null;
    return (_jsxs("div", { id: props.titleId, className: "insight-menu-title-wrapper", children: [
            _jsx(Typography, { tagName: "h3", className: "widget-title s-widget-title", children: renderedTitle }), renderMode === "edit" && titlesDiffer ? _jsx(OriginalInsightTitle, { title: originalTitle }) : null] }));
}
//# sourceMappingURL=DefaultDashboardInsightMenuTitle.js.map