Skip to content

Commit 6526b7e

Browse files
Apply suggested fix to src/components/module/singleVideo/listVideos/Pagination.tsx from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
1 parent 94a51e3 commit 6526b7e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/components/module/singleVideo/listVideos/Pagination.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const Pagination = ({ itemsPerPage = 5, items = defaultItems }: PaginationProps)
2222
const [currentPage, setCurrentPage] = useState(1);
2323
const safeItemsPerPage = Math.max(1, Math.trunc(itemsPerPage));
2424

25-
const totalPages = Math.ceil(items.length / safeItemsPerPage);
25+
const totalPages = Math.max(1, Math.ceil(items.length / safeItemsPerPage));
2626
const startIndex = (currentPage - 1) * safeItemsPerPage;
2727
const currentItems = items.slice(
2828
startIndex,

0 commit comments

Comments
 (0)