Files
suwayomi-material-you-webui/src/components/reader/PageNumber.tsx

39 lines
1.0 KiB
TypeScript
Raw Normal View History

/*
* 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 Box from '@mui/material/Box';
import { IReaderSettings } from '@/typings';
2021-05-15 17:18:57 +04:30
interface IProps {
settings: IReaderSettings;
curPage: number;
pageCount: number;
2021-05-15 17:18:57 +04:30
}
2023-10-28 00:32:02 +02:00
export function PageNumber(props: IProps) {
2021-05-15 17:18:57 +04:30
const { settings, curPage, pageCount } = props;
return (
<Box
sx={{
display: settings.showPageNumber ? 'block' : 'none',
position: 'fixed',
bottom: '50px',
padding: '2px',
paddingLeft: '4px',
paddingRight: '4px',
textAlign: 'center',
backgroundColor: 'rgba(0, 0, 0, 0.3)',
borderRadius: '10px',
}}
>
2021-05-15 17:18:57 +04:30
{`${curPage + 1} / ${pageCount}`}
</Box>
2021-05-15 17:18:57 +04:30
);
}