[ SYSTEM ]: Linux wordpress 6.1.0-44-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.164-1 (2026-03-09) x86_64
[ SERVER ]: Apache/2.4.66 (Debian) | PHP: 8.2.30
[ USER ]: www-data | IP: 172.19.30.54
GEFORCE FILE MANAGER
/
var
/
www
/
html
/
wordpress
/
wp-content
/
plugins
/
presto-player
/
src
/
admin
/
ui
/
UPLOAD:
NAME
SIZE
QUICK PERMS
ACTIONS
📄 Menu.js
3,962 B
SET
[ EDIT ]
|
[ DEL ]
📄 Pagination.js
1,949 B
SET
[ EDIT ]
|
[ DEL ]
📄 StatCard.js
508 B
SET
[ EDIT ]
|
[ DEL ]
📄 Table.js
2,286 B
SET
[ EDIT ]
|
[ DEL ]
DELETE SELECTED
[ CLOSE ]
EDIT: Pagination.js
import { __, sprintf } from "@wordpress/i18n"; const { Card, CardBody, Flex, FlexBlock, Button, ButtonGroup } = wp.components; const { useState, useEffect } = wp.element; export default ({ page, setPage, perPage, total, totalPages }) => { // do we have prev/next const [hasPrevious, setHasPrevious] = useState(false); const [hasNext, setHasNext] = useState(false); // end and start cursors const [end, setEnd] = useState(0); const [start, setStart] = useState(0); // set end and start useEffect(() => { setEnd(Math.min(perPage * page, total)); setStart(perPage * (page - 1) + 1); }, [perPage, page, total]); // update page when pagination is clicked const nextPage = () => { setPage(Math.min(totalPages, page + 1)); }; const prevPage = () => { setPage(Math.max(page - 1, 0)); }; // set prev/next useEffect(() => { setHasPrevious(page - 1 > 0); setHasNext(totalPages >= page + 1); }, [page, totalPages]); return ( <Card size="large" className="presto-card pagination"> <CardBody className="presto-flow"> <Flex> <FlexBlock> {sprintf( __("Showing %1s to %2s of %3s", "presto-player"), start, end, total )} </FlexBlock> <FlexBlock> <Flex justify="flex-end"> { <ButtonGroup> <Button isSecondary disabled={!hasPrevious} onClick={prevPage} > {__("Previous", "presto-player")} </Button> <Button isSecondary disabled={!hasNext} onClick={nextPage}> {__("Next", "presto-player")} </Button> </ButtonGroup> } </Flex> </FlexBlock> </Flex> </CardBody> </Card> ); };