🔎 Wiring up the Library page for elasticsearch-powered, search

This commit is contained in:
2022-03-07 03:05:15 -08:00
parent a7a536c647
commit bb3e01ca24
10 changed files with 194 additions and 112 deletions

View File

@@ -0,0 +1,36 @@
import { isEmpty } from "lodash";
import React, { ReactElement, useEffect } from "react";
import { useDispatch, useSelector } from "react-redux";
import { searchIssue } from "../../actions/fileops.actions";
import { Library } from "./Library";
const LibraryContainer = () => {
const dispatch = useDispatch();
useEffect(() => {
dispatch(
searchIssue(
{
query: {},
},
{
pagination: {
size: 25,
from: 0,
},
},
),
);
}, []);
const searchResults = useSelector(
(state: RootState) => state.fileOps.librarySearchResults,
);
return !isEmpty(searchResults) ? (
<Library data={{ searchResults }} />
) : (
"asdasd"
);
};
export default LibraryContainer;