Files
suwayomi-material-you-webui/src/components/manga/ResumeFAB.tsx
T

42 lines
1.1 KiB
TypeScript
Raw Normal View History

2022-01-24 15:09:28 +05:30
/*
* 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/.
*/
2022-01-24 15:09:28 +05:30
import React from 'react';
import { Link } from 'react-router-dom';
import { PlayArrow } from '@mui/icons-material';
2023-03-23 13:59:32 +01:00
import { useTranslation } from 'react-i18next';
2023-06-05 01:42:39 +02:00
import { IChapter } from '@/typings';
import { BACK } from '@/util/useBackTo';
import StyledFab from '@/components/util/StyledFab';
2022-01-24 15:09:28 +05:30
2023-02-06 10:06:33 +01:00
interface ResumeFABProps {
chapter: IChapter;
mangaId: string;
2022-01-24 15:09:28 +05:30
}
export default function ResumeFab(props: ResumeFABProps) {
2023-03-23 13:59:32 +01:00
const { t } = useTranslation();
2023-02-06 10:06:33 +01:00
const {
chapter: { index },
2023-02-06 10:06:33 +01:00
mangaId,
} = props;
2022-01-24 15:09:28 +05:30
return (
<StyledFab
2022-01-24 15:09:28 +05:30
component={Link}
variant="extended"
color="primary"
to={`/manga/${mangaId}/chapter/${index}`}
state={{ backLink: BACK }}
2022-01-24 15:09:28 +05:30
>
<PlayArrow />
2023-03-23 13:59:32 +01:00
{index === 1 ? t('global.button.start') : t('global.button.resume')}
</StyledFab>
2022-01-24 15:09:28 +05:30
);
}