import React from 'react';
import { ChevronCollapseSmall, ChevronExpandSmall, } from '@wix/wix-ui-icons-common';
import { Box, TextButton, Tooltip } from '@wix/design-system';
import { observer } from 'mobx-react-lite';
const _NestedTableMainColumnTitle = ({ state, }) => {
    const { translate: t } = state.container;
    const isAllCollapsed = state.nestedMode.isAllCollapsed;
    const ShowShowExpandCollapseAllButton = !state.nestedMode.isFetchAllAborted && state.nestedMode.hasExpandableItems;
    const titleText = state.mainColumn?.title;
    return (React.createElement(Box, { direction: "horizontal", verticalAlign: "middle", paddingInline: state.nested.nestedTableDragAndDrop ? '2px' : 0 },
        React.createElement(Box, { width: state.nested.nestedTableDragAndDrop ? '54px' : '36px' }, ShowShowExpandCollapseAllButton && (React.createElement(Tooltip, { content: isAllCollapsed
                ? t('cairo.collectionPage.nested.expandAll.tooltip')
                : t('cairo.collectionPage.nested.collapseAll.tooltip') },
            React.createElement(TextButton, { dataHook: "nested-table-expand-collapse-all-button", size: "small", prefixIcon: isAllCollapsed ? (React.createElement(ChevronExpandSmall, { "data-hook": "expand-icon" })) : (React.createElement(ChevronCollapseSmall, { "data-hook": "collapse-icon" })), onClick: () => {
                    state.nestedMode.expandCollapseAll();
                } })))),
        titleText && React.createElement(Box, null, titleText)));
};
export const NestedTableMainColumnTitle = observer(_NestedTableMainColumnTitle);
//# sourceMappingURL=NestedTableMainColumnTitle.js.map