Include chapter info in continue reading button tooltip

This commit is contained in:
schroda
2025-09-18 20:37:51 +02:00
parent 5456428916
commit 80a576db63
10 changed files with 252 additions and 58 deletions

View File

@@ -11,22 +11,48 @@ import PlayArrow from '@mui/icons-material/PlayArrow';
import { useTranslation } from 'react-i18next';
import { StyledFab } from '@/base/components/buttons/StyledFab.tsx';
import { Chapters } from '@/features/chapter/services/Chapters.ts';
import { ChapterMangaInfo, ChapterReadInfo, ChapterSourceOrderInfo } from '@/features/chapter/Chapter.types.ts';
import {
ChapterMangaInfo,
ChapterNameInfo,
ChapterNumberInfo,
ChapterReadInfo,
ChapterScanlatorInfo,
ChapterSourceOrderInfo,
} from '@/features/chapter/Chapter.types.ts';
import { ContinueReadingTooltip } from '@/features/manga/components/ContinueReadingTooltip.tsx';
export function ResumeFab({ chapter }: { chapter: ChapterMangaInfo & ChapterSourceOrderInfo & ChapterReadInfo }) {
export function ResumeFab({
chapter,
}: {
chapter: ChapterMangaInfo &
ChapterSourceOrderInfo &
ChapterReadInfo &
ChapterNumberInfo &
ChapterNameInfo &
ChapterScanlatorInfo;
}) {
const { t } = useTranslation();
const { sourceOrder } = chapter;
const { sourceOrder, name, chapterNumber, scanlator } = chapter;
const isFirstChapter = sourceOrder === 1;
return (
<StyledFab
component={Link}
variant="extended"
color="primary"
to={Chapters.getReaderUrl(chapter)}
state={Chapters.getReaderOpenChapterLocationState(chapter)}
<ContinueReadingTooltip
chapterNumber={chapterNumber}
name={name}
sourceOrder={sourceOrder}
scanlator={scanlator}
>
<PlayArrow />
{sourceOrder === 1 ? t('global.button.start') : t('global.button.resume')}
</StyledFab>
<StyledFab
component={Link}
variant="extended"
color="primary"
to={Chapters.getReaderUrl(chapter)}
state={Chapters.getReaderOpenChapterLocationState(chapter)}
>
<PlayArrow />
{isFirstChapter ? t('global.button.start') : t('global.button.resume')}
</StyledFab>
</ContinueReadingTooltip>
);
}