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/.
|
|
|
|
|
*/
|
|
|
|
|
|
2023-03-23 13:59:32 +01:00
|
|
|
import { useTranslation } from 'react-i18next';
|
2023-10-28 00:32:02 +02:00
|
|
|
import { MangaGrid, IMangaGridProps } from '@/components/MangaGrid';
|
2023-10-15 16:03:08 +02:00
|
|
|
import { TPartialManga } from '@/typings.ts';
|
2022-03-04 01:25:10 +00:00
|
|
|
|
2023-10-15 16:03:08 +02:00
|
|
|
function filterManga(mangas: TPartialManga[]): TPartialManga[] {
|
2022-03-04 01:25:10 +00:00
|
|
|
return mangas;
|
|
|
|
|
}
|
|
|
|
|
|
2023-10-28 00:32:02 +02:00
|
|
|
export function SourceMangaGrid(props: IMangaGridProps) {
|
2023-03-23 13:59:32 +01:00
|
|
|
const { t } = useTranslation();
|
2023-06-17 16:50:17 +02:00
|
|
|
const { mangas, isLoading, hasNextPage, loadMore, message, messageExtra, gridLayout } = props;
|
2022-03-04 01:25:10 +00:00
|
|
|
|
|
|
|
|
const filteredManga = filterManga(mangas);
|
|
|
|
|
const showFilteredOutMessage = filteredManga.length === 0 && mangas.length > 0;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<MangaGrid
|
|
|
|
|
mangas={filteredManga}
|
|
|
|
|
isLoading={isLoading}
|
|
|
|
|
hasNextPage={hasNextPage}
|
2023-06-17 16:50:17 +02:00
|
|
|
loadMore={loadMore}
|
2023-03-23 13:59:32 +01:00
|
|
|
message={showFilteredOutMessage ? t('manga.error.label.no_matches') : message}
|
2022-03-04 01:25:10 +00:00
|
|
|
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
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
}
|