Repository URL to install this package:
|
Version:
3.12.16 ▾
|
import { useSelector } from 'react-redux';
import { useExplorer } from '../../hooks';
import Styled from './EmptyFolderPlaceholder.styled';
import { selectSearchSuggestionsFilters, selectSearchSuggestionsTags } from '../../slices/search.slice';
import { selectIsFavoritesView, selectIsProductView, selectIsShareboxView } from '../../slices/views.slice';
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
var EmptyFolderPlaceholder = function EmptyFolderPlaceholder() {
var _useExplorer = useExplorer(),
i18n = _useExplorer.i18n;
var searchSuggestionsFilters = useSelector(selectSearchSuggestionsFilters);
var searchSuggestionsTags = useSelector(selectSearchSuggestionsTags);
var isProductView = useSelector(selectIsProductView);
var isFavoritesView = useSelector(selectIsFavoritesView);
var isShareboxView = useSelector(selectIsShareboxView);
var getPlaceholderTitle = function getPlaceholderTitle() {
if (isProductView && !searchSuggestionsFilters && !searchSuggestionsTags) {
return i18n('mutualizedProductsNoProducts');
}
if (isFavoritesView) {
return i18n('foldersViewNoFilesFoundText');
}
if (isShareboxView) {
return i18n('foldersViewNoFilesOrFoldersFoundText');
}
return i18n('foldersViewNoFilesOrFoldersFoundText');
};
var renderPlaceholderDesc = function renderPlaceholderDesc() {
if (isFavoritesView || isShareboxView) return;
var desc = i18n('foldersViewDragAndDropFilesHereText');
if (isProductView && !searchSuggestionsFilters && !searchSuggestionsTags) {
desc = i18n('mutualizedProductsNoProductsHint');
}
return /*#__PURE__*/_jsx(Styled.Hint, {
children: desc
});
};
return /*#__PURE__*/_jsxs(Styled.Wrapper, {
children: [/*#__PURE__*/_jsx(Styled.NoFilesIcon, {
size: 150
}), /*#__PURE__*/_jsx(Styled.Title, {
children: getPlaceholderTitle()
}), renderPlaceholderDesc()]
});
};
export default EmptyFolderPlaceholder;