import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
// (C) 2019-2025 GoodData Corporation
import { memo } from "react";
import { LabelFormatControl } from "./LabelFormatControl.js";
import { LabelRotationControl } from "./LabelRotationControl.js";
import { messages } from "../../../../locales.js";
import { ConfigSubsection } from "../../configurationControls/ConfigSubsection.js";
export const LabelSubsection = memo(function LabelSubsection(props) {
    const getControlProperties = () => {
        const axisProperties = props.properties?.controls?.[props.axis];
        const axisVisible = axisProperties?.visible ?? true;
        const axisLabelsEnabled = axisProperties?.labelsEnabled ?? true;
        return {
            axisVisible,
            axisLabelsEnabled,
        };
    };
    const { axisVisible, axisLabelsEnabled } = getControlProperties();
    return (_jsxs(ConfigSubsection, { axisType: props.axis, title: messages["axisLabels"].id, valuePath: `${props.axis}.labelsEnabled`, properties: props.properties, pushData: props.pushData, canBeToggled: true, toggledOn: axisLabelsEnabled, toggleDisabled: props.disabled || !axisVisible, showDisabledMessage: !props.configPanelDisabled && props.disabled, children: [props.showFormat ? (_jsx(LabelFormatControl, { disabled: props.disabled, configPanelDisabled: props.configPanelDisabled, axis: props.axis, properties: props.properties, pushData: props.pushData })) : null, _jsx(LabelRotationControl, { disabled: props.disabled, configPanelDisabled: props.configPanelDisabled, axis: props.axis, properties: props.properties, pushData: props.pushData })
        ] }));
});
//# sourceMappingURL=LabelSubsection.js.map