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