import { GridSectionHeader } from './GridSectionHeader';
import { TextButton } from '@wix/design-system';
import { VirtualGridRepeater } from '../VirtualGridRepeater/VirtualGridRepeater';
import { PageGridInfiniteScrollLoader } from '../PageGridInfiniteScrollLoader';
import React from 'react';
import { observer } from 'mobx-react-lite';
import { GridFoldersSection } from './GridFoldersSection';
import { InitialSkeletonLoader } from '../InitialLoader/InitialSkeletonLoader';
function _GridFoldersFolderSection({ state, renderItem, sectionTitle, }) {
    const { container: { translate: t }, toolbar, folders: { collection: { showRefreshLoader }, }, } = state;
    return (React.createElement(GridFoldersSection, { state: state.folders, dataHook: "folders-section", header: state.showFoldersSectionHeader && (React.createElement(GridSectionHeader, { state: toolbar, suffix: state.showToggleShowAllLessButton && (React.createElement(TextButton, { size: "small", onClick: state.toggleShowAllFolders, dataHook: "toggle-show-all-folders-button" }, state.showAllFolders
                ? t('cairo.folders.showLess.button')
                : t('cairo.folders.showAll.button'))), sectionTitle: sectionTitle ?? t('section.header.folders') })) },
        React.createElement(VirtualGridRepeater, { renderItem: renderItem, gridState: state.folders }),
        showRefreshLoader && (React.createElement(InitialSkeletonLoader, { dataHook: "refresh-loader", state: state.folders })),
        state.showAllFolders && (React.createElement(PageGridInfiniteScrollLoader, { dataHook: "folders-infinite-scroll-loader", state: state.folders, scrollMoreAlways: true }))));
}
export const GridFoldersFolderSection = observer(_GridFoldersFolderSection);
//# sourceMappingURL=GridFoldersFolderSection.js.map