2022-03-04 01:25:10 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (C) Contributors to the Suwayomi project
|
|
|
|
|
*
|
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
|
import MangaGrid, { IMangaGridProps } from 'components/MangaGrid';
|
|
|
|
|
|
|
|
|
|
const FILTERED_OUT_MESSAGE = 'There are no Manga matching this filter';
|
|
|
|
|
|
|
|
|
|
function filterManga(mangas: IMangaCard[]): IMangaCard[] {
|
|
|
|
|
return mangas;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default function SourceMangaGrid(props: IMangaGridProps) {
|
|
|
|
|
const {
|
2023-02-06 10:06:33 +01:00
|
|
|
mangas,
|
|
|
|
|
isLoading,
|
|
|
|
|
hasNextPage,
|
|
|
|
|
lastPageNum,
|
|
|
|
|
setLastPageNum,
|
|
|
|
|
message,
|
|
|
|
|
messageExtra,
|
|
|
|
|
gridLayout,
|
2022-03-04 01:25:10 +00:00
|
|
|
} = props;
|
|
|
|
|
|
|
|
|
|
const filteredManga = filterManga(mangas);
|
|
|
|
|
const showFilteredOutMessage = filteredManga.length === 0 && mangas.length > 0;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<MangaGrid
|
|
|
|
|
mangas={filteredManga}
|
|
|
|
|
isLoading={isLoading}
|
|
|
|
|
hasNextPage={hasNextPage}
|
|
|
|
|
lastPageNum={lastPageNum}
|
|
|
|
|
setLastPageNum={setLastPageNum}
|
|
|
|
|
message={showFilteredOutMessage ? FILTERED_OUT_MESSAGE : message}
|
|
|
|
|
messageExtra={messageExtra}
|
2022-03-06 21:02:06 +00:00
|
|
|
gridLayout={gridLayout}
|
2022-11-24 21:04:30 +01:00
|
|
|
inLibraryIndicator
|
2022-03-04 01:25:10 +00:00
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
}
|