import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { CalculateAs } from "@gooddata/sdk-ui-charts";
import { ComparisonPositionControl } from "./ComparisonPositionControl.js";
import { NumberFormatControl } from "./numberFormat/NumberFormatControl.js";
import { comparisonMessages } from "../../../../../locales.js";
import { getNumberFormat, getNumberSubFormat } from "../../../../utils/comparisonHelper.js";
import { ConfigSubsection } from "../../ConfigSubsection.js";
import { COMPARISON_FORMAT_VALUE_PATH, COMPARISON_SUB_FORMAT_VALUE_PATH } from "../ComparisonValuePath.js";
export function ValueSubSection({ sectionDisabled, showDisabledMessage, defaultFormat, separators, properties, pushData, }) {
    const format = getNumberFormat(properties, defaultFormat);
    const subFormat = getNumberSubFormat(properties);
    const shouldDisplaySubFormatControl = properties.controls?.comparison?.calculationType === CalculateAs.CHANGE_DIFFERENCE;
    return (_jsxs(ConfigSubsection, { title: comparisonMessages["valueSubSectionTitle"].id, canBeToggled: false, children: [_jsx(NumberFormatControl, { disabled: sectionDisabled, valuePath: COMPARISON_FORMAT_VALUE_PATH, labelText: comparisonMessages["formatTitle"].id, format: format, showDisabledMessage: showDisabledMessage, separators: separators, properties: properties, pushData: pushData }), shouldDisplaySubFormatControl ? (_jsx(NumberFormatControl, { disabled: sectionDisabled, valuePath: COMPARISON_SUB_FORMAT_VALUE_PATH, labelText: comparisonMessages["subFormatTitle"].id, format: subFormat, showDisabledMessage: showDisabledMessage, separators: separators, properties: properties, pushData: pushData })) : null, _jsx(ComparisonPositionControl, { disabled: sectionDisabled, showDisabledMessage: showDisabledMessage, properties: properties, pushData: pushData })] }));
}
//# sourceMappingURL=ValueSubSection.js.map