2025-03-10 22:20:46 +01: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 { Link } from 'react-router-dom';
|
|
|
|
|
import { AppRoutes } from '@/modules/core/AppRoute.constants.ts';
|
|
|
|
|
import { Mangas } from '@/modules/manga/services/Mangas.ts';
|
|
|
|
|
import { MangaIdInfo, MangaThumbnailInfo } from '@/modules/manga/Manga.types.ts';
|
|
|
|
|
import { MangaType } from '@/lib/graphql/generated/graphql.ts';
|
2025-04-25 00:50:51 +02:00
|
|
|
import { ListCardAvatar } from '@/modules/core/components/cards/list/ListCardAvatar.tsx';
|
2025-03-10 22:20:46 +01:00
|
|
|
|
|
|
|
|
export const ChapterCardThumbnail = ({
|
|
|
|
|
mangaId,
|
|
|
|
|
mangaTitle,
|
|
|
|
|
thumbnailUrl,
|
|
|
|
|
thumbnailUrlLastFetched,
|
|
|
|
|
}: MangaThumbnailInfo & {
|
|
|
|
|
mangaId: MangaIdInfo['id'];
|
|
|
|
|
mangaTitle: MangaType['title'];
|
|
|
|
|
}) => (
|
|
|
|
|
<Link to={AppRoutes.manga.path(mangaId)} style={{ textDecoration: 'none' }}>
|
2025-04-25 00:50:51 +02:00
|
|
|
<ListCardAvatar
|
|
|
|
|
iconUrl={Mangas.getThumbnailUrl({ thumbnailUrl, thumbnailUrlLastFetched })}
|
|
|
|
|
alt={mangaTitle}
|
|
|
|
|
slots={{ spinnerImageProps: { imgStyle: { imageRendering: 'pixelated' } } }}
|
|
|
|
|
/>
|
2025-03-10 22:20:46 +01:00
|
|
|
</Link>
|
|
|
|
|
);
|