"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.NestedTableMainColumnTitle = void 0;
var _react = _interopRequireDefault(require("react"));
var _wixUiIconsCommon = require("@wix/wix-ui-icons-common");
var _designSystem = require("@wix/design-system");
var _mobxReactLite = require("mobx-react-lite");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/components/NestedTable/NestedTableMainColumnTitle.tsx";
const _NestedTableMainColumnTitle = ({
  state
}) => {
  var _state$mainColumn;
  const {
    translate: t
  } = state.container;
  const isAllCollapsed = state.nestedMode.isAllCollapsed;
  const ShowShowExpandCollapseAllButton = !state.nestedMode.isFetchAllAborted && state.nestedMode.hasExpandableItems;
  const titleText = (_state$mainColumn = state.mainColumn) == null ? void 0 : _state$mainColumn.title;
  return /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
    direction: "horizontal",
    verticalAlign: "middle",
    paddingInline: state.nested.nestedTableDragAndDrop ? '2px' : 0,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 25,
      columnNumber: 5
    }
  }, /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
    width: state.nested.nestedTableDragAndDrop ? '54px' : '36px',
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 30,
      columnNumber: 7
    }
  }, ShowShowExpandCollapseAllButton && /*#__PURE__*/_react.default.createElement(_designSystem.Tooltip, {
    content: isAllCollapsed ? t('cairo.collectionPage.nested.expandAll.tooltip') : t('cairo.collectionPage.nested.collapseAll.tooltip'),
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 32,
      columnNumber: 11
    }
  }, /*#__PURE__*/_react.default.createElement(_designSystem.TextButton, {
    dataHook: "nested-table-expand-collapse-all-button",
    size: "small",
    prefixIcon: isAllCollapsed ? /*#__PURE__*/_react.default.createElement(_wixUiIconsCommon.ChevronExpandSmall, {
      "data-hook": "expand-icon",
      __self: void 0,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 44,
        columnNumber: 19
      }
    }) : /*#__PURE__*/_react.default.createElement(_wixUiIconsCommon.ChevronCollapseSmall, {
      "data-hook": "collapse-icon",
      __self: void 0,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 46,
        columnNumber: 19
      }
    }),
    onClick: () => {
      state.nestedMode.expandCollapseAll();
    },
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 39,
      columnNumber: 13
    }
  }))), titleText && /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 56,
      columnNumber: 21
    }
  }, titleText));
};
const NestedTableMainColumnTitle = exports.NestedTableMainColumnTitle = (0, _mobxReactLite.observer)(_NestedTableMainColumnTitle);
//# sourceMappingURL=NestedTableMainColumnTitle.js.map