Skip to content

Commit

Permalink
fix: added optional variable to pagination component
Browse files Browse the repository at this point in the history
  • Loading branch information
corypride committed Jan 20, 2025
1 parent b749b10 commit fb30844
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions frontend/src/Components/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@ import {
export default function Pagination({
meta,
setPage,
setPerPage
setPerPage,
specialPageSelecton
}: {
meta: PaginationMeta;
setPage: (page: number) => void;
setPerPage?: (perPage: number) => void;
specialPageSelecton?: boolean;
}) {
const page = meta.current_page - 1;
const perPage = meta.per_page;
const perPageSelections = [10, 20, 50, 100];
const perPageSelections = specialPageSelecton
? [12, 24, 60, 120]
: [10, 20, 50, 100];
return (
<div className="join place-content-center">
<div
Expand Down
1 change: 1 addition & 0 deletions frontend/src/Pages/VideoManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ export default function VideoManagement() {
meta={meta}
setPage={setPageQuery}
setPerPage={handleSetPerPage}
specialPageSelecton
/>
</div>
)}
Expand Down

0 comments on commit fb30844

Please sign in to comment.