"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.GridFoldersFolderSection = void 0;
var _GridSectionHeader = require("./GridSectionHeader");
var _designSystem = require("@wix/design-system");
var _VirtualGridRepeater = require("../VirtualGridRepeater/VirtualGridRepeater");
var _PageGridInfiniteScrollLoader = require("../PageGridInfiniteScrollLoader");
var _react = _interopRequireDefault(require("react"));
var _mobxReactLite = require("mobx-react-lite");
var _GridFoldersSection = require("./GridFoldersSection");
var _InitialSkeletonLoader = require("../InitialLoader/InitialSkeletonLoader");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/components/Grid/GridFoldersFolderSection.tsx";
function _GridFoldersFolderSection({
  state,
  renderItem,
  sectionTitle
}) {
  const {
    container: {
      translate: t
    },
    toolbar,
    folders: {
      collection: {
        showRefreshLoader
      }
    }
  } = state;
  return /*#__PURE__*/_react.default.createElement(_GridFoldersSection.GridFoldersSection, {
    state: state.folders,
    dataHook: "folders-section",
    header: state.showFoldersSectionHeader && /*#__PURE__*/_react.default.createElement(_GridSectionHeader.GridSectionHeader, {
      state: toolbar,
      suffix: state.showToggleShowAllLessButton && /*#__PURE__*/_react.default.createElement(_designSystem.TextButton, {
        size: "small",
        onClick: state.toggleShowAllFolders,
        dataHook: "toggle-show-all-folders-button",
        __self: this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 52,
          columnNumber: 17
        }
      }, state.showAllFolders ? t('cairo.folders.showLess.button') : t('cairo.folders.showAll.button')),
      sectionTitle: sectionTitle ?? t('section.header.folders'),
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 48,
        columnNumber: 11
      }
    }),
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 43,
      columnNumber: 5
    }
  }, /*#__PURE__*/_react.default.createElement(_VirtualGridRepeater.VirtualGridRepeater, {
    renderItem: renderItem,
    gridState: state.folders,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 68,
      columnNumber: 7
    }
  }), showRefreshLoader && /*#__PURE__*/_react.default.createElement(_InitialSkeletonLoader.InitialSkeletonLoader, {
    dataHook: "refresh-loader",
    state: state.folders,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 71,
      columnNumber: 9
    }
  }), state.showAllFolders && /*#__PURE__*/_react.default.createElement(_PageGridInfiniteScrollLoader.PageGridInfiniteScrollLoader, {
    dataHook: "folders-infinite-scroll-loader",
    state: state.folders,
    scrollMoreAlways: true,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 77,
      columnNumber: 9
    }
  }));
}
const GridFoldersFolderSection = exports.GridFoldersFolderSection = (0, _mobxReactLite.observer)(_GridFoldersFolderSection);
//# sourceMappingURL=GridFoldersFolderSection.js.map