import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
// (C) 2019-2025 GoodData Corporation
import { useIntl } from "react-intl";
import { ConfigSubsection } from "./ConfigSubsection.js";
import { DropdownControl } from "./DropdownControl.js";
import { ColumnHeaderTextWrappingControl } from "./PivotTableTextWrappingControl.js";
import { messages } from "../../../locales.js";
import { columnHeadersPositionDropdownItems } from "../../constants/dropdowns.js";
import { isSetColumnHeadersPositionToLeftAllowed } from "../../utils/controlsHelper.js";
import { getTranslatedDropdownItems } from "../../utils/translations.js";
export function ColumnHeadersPositionControl({ pushData, properties, isDisabled, defaultValue = "top", insight, isLoading, enableNewPivotTable = true, }) {
    const intl = useIntl();
    const columnHeadersPosition = isSetColumnHeadersPositionToLeftAllowed(insight)
        ? (properties?.controls?.["columnHeadersPosition"] ?? defaultValue)
        : defaultValue;
    return (_jsxs(ConfigSubsection, { title: messages["columnHeaderPositionTitle"].id, children: [
            _jsx(DropdownControl, { value: columnHeadersPosition, valuePath: "columnHeadersPosition", labelText: messages["columnHeaderPositionLabel"].id, disabled: isDisabled, properties: properties, pushData: pushData, items: getTranslatedDropdownItems(columnHeadersPositionDropdownItems, intl), showDisabledMessage: isDisabled }), enableNewPivotTable ? (_jsx(ColumnHeaderTextWrappingControl, { properties: properties, pushData: pushData, disabled: isLoading })) : null] }));
}
//# sourceMappingURL=ColumnHeadersPositionControl.js.map