import React, { ReactElement, useEffect, useMemo } from "react"; import { useDispatch, useSelector } from "react-redux"; import { searchIssue } from "../../actions/fileops.actions"; import SearchBar from "../Library/SearchBar"; import T2Table from "../shared/T2Table"; import { isEmpty, isUndefined } from "lodash"; import MetadataPanel from "../shared/MetadataPanel"; export const WantedComics = (props): ReactElement => { const wantedComics = useSelector( (state: RootState) => state.fileOps.librarySearchResults, ); const dispatch = useDispatch(); useEffect(() => { dispatch( searchIssue( { query: {}, }, { pagination: { size: 25, from: 0, }, type: "wanted", }, ), ); }, []); const columnData = useMemo( () => [ { Header: "Comic Information", columns: [ { Header: "Details", id: "comicDetails", minWidth: 350, accessor: "_source", Cell: ({ value }) => , }, ], }, { Header: "Download Status", columns: [ { Header: "Files", accessor: "_source.acquisition.directconnect", align: "right", Cell: (props) => { return (
{props.cell.value.length > 0 ? ( {props.cell.value.length} ) : null}
); }, }, { Header: "Type", id: "Air", }, { Header: "Type", id: "dcc", }, ], }, ], [], ); return (

Wanted Comics

{/* Search bar */} {!isUndefined(wantedComics.hits) && (
{/* pagination controls */}
)}
); }; export default WantedComics;