forked from openedx/frontend-app-authoring
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLibraryCollectionComponents.tsx
More file actions
32 lines (28 loc) · 1.02 KB
/
LibraryCollectionComponents.tsx
File metadata and controls
32 lines (28 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { Stack } from '@openedx/paragon';
import { NoComponents, NoSearchResults } from '../EmptyStates';
import { useSearchContext } from '../../search-manager';
import messages from './messages';
import { useSidebarContext } from '../common/context/SidebarContext';
import LibraryContent from '../LibraryContent';
const LibraryCollectionComponents = () => {
const { totalHits: componentCount, isFiltered } = useSearchContext();
const { openAddContentSidebar } = useSidebarContext();
if (componentCount === 0) {
return isFiltered
? <NoSearchResults infoText={messages.noSearchResultsInCollection} />
: (
<NoComponents
infoText={messages.noComponentsInCollection}
addBtnText={messages.addComponentsInCollection}
handleBtnClick={openAddContentSidebar}
/>
);
}
return (
<Stack direction="vertical" gap={3}>
<h3 className="text-gray">Content ({componentCount})</h3>
<LibraryContent />
</Stack>
);
};
export default LibraryCollectionComponents;