import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
// (C) 2023-2025 GoodData Corporation
import { startCase } from "lodash-es";
import { FormattedMessage } from "react-intl";
import { comparisonMessages } from "../../../../../locales.js";
const SECTION_TITLE_KEYS = {
    example: comparisonMessages["calculationTooltipExampleSection"].id,
    formula: comparisonMessages["calculationTooltipFormulaSection"].id,
    formulaChange: comparisonMessages["calculationTooltipFormulaChangeSection"].id,
    formulaDifference: comparisonMessages["calculationTooltipFormulaDifferenceSection"].id,
};
const SECTION_CONTENT_KEYS = {
    exampleChange: comparisonMessages["calculatedAsChangeTooltipExample"].id,
    useInChange: comparisonMessages["calculatedAsChangeTooltipUseIn"].id,
    formulaChange: comparisonMessages["calculatedAsChangeTooltipFormula"].id,
    exampleRatio: comparisonMessages["calculatedAsRatioTooltipExample"].id,
    useInRatio: comparisonMessages["calculatedAsRatioTooltipUseIn"].id,
    formulaRatio: comparisonMessages["calculatedAsRatioTooltipFormula"].id,
    exampleDifference: comparisonMessages["calculatedAsDifferenceTooltipExample"].id,
    useInDifference: comparisonMessages["calculatedAsDifferenceTooltipUseIn"].id,
    formulaDifference: comparisonMessages["calculatedAsDifferenceTooltipFormula"].id,
    exampleChangeDifference: comparisonMessages["calculatedAsChangeDifferenceTooltipExample"].id,
    useInChangeDifference: comparisonMessages["calculatedAsChangeDifferenceTooltipUseIn"].id,
};
const toPascalCase = (value) => {
    return startCase(value).replace(/\s/g, "");
};
const getSectionTitleKey = (section, calculationType, isSectionCombineCalculationType) => {
    const property = isSectionCombineCalculationType ? `${section}${toPascalCase(calculationType)}` : section;
    return SECTION_TITLE_KEYS[property];
};
const getSectionContentKey = (section, calculationType) => {
    const property = `${section}${toPascalCase(calculationType)}`;
    return SECTION_CONTENT_KEYS[property];
};
export function CalculationListItemInfoSection({ calculationType, section, contentClassNames, shouldHideTitle, isSectionCombineCalculationType, }) {
    const titleKey = getSectionTitleKey(section, calculationType, !!isSectionCombineCalculationType);
    const contentKey = getSectionContentKey(section, calculationType);
    return (_jsxs(_Fragment, { children: [shouldHideTitle ? null : _jsx(FormattedMessage, { id: titleKey, tagName: "h4" }), _jsx("p", { className: contentClassNames, children: _jsx(FormattedMessage, { id: contentKey }) })
        ] }));
}
//# sourceMappingURL=CalculationListItemInfoSection.js.map