"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.GridFoldersItemsSection = void 0;
var _GridSectionHeader = require("./GridSectionHeader");
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/GridFoldersItemsSection.tsx";
function _GridFoldersItemsSection({
  state,
  renderItem,
  sectionTitle
}) {
  const {
    container: {
      translate: t
    },
    toolbar,
    items: {
      collection: {
        showRefreshLoader
      }
    }
  } = state;
  return /*#__PURE__*/_react.default.createElement(_GridFoldersSection.GridFoldersSection, {
    state: state.items,
    dataHook: "items-section",
    header: state.showItemsSectionHeader && /*#__PURE__*/_react.default.createElement(_GridSectionHeader.GridSectionHeader, {
      state: toolbar,
      sectionTitle: sectionTitle ?? t('section.header.items'),
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 47,
        columnNumber: 11
      }
    }),
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 42,
      columnNumber: 5
    }
  }, /*#__PURE__*/_react.default.createElement(_VirtualGridRepeater.VirtualGridRepeater, {
    renderItem: renderItem,
    gridState: state.items,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 54,
      columnNumber: 7
    }
  }), showRefreshLoader && /*#__PURE__*/_react.default.createElement(_InitialSkeletonLoader.InitialSkeletonLoader, {
    dataHook: "refresh-loader",
    state: state.items,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 57,
      columnNumber: 9
    }
  }), /*#__PURE__*/_react.default.createElement(_PageGridInfiniteScrollLoader.PageGridInfiniteScrollLoader, {
    dataHook: "items-infinite-scroll-loader",
    state: state.items,
    scrollMoreAlways: true,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 60,
      columnNumber: 7
    }
  }));
}
const GridFoldersItemsSection = exports.GridFoldersItemsSection = (0, _mobxReactLite.observer)(_GridFoldersItemsSection);
//# sourceMappingURL=GridFoldersItemsSection.js.map