From aadbda770b5a6479688c40ae6c6f36cc904e06ac Mon Sep 17 00:00:00 2001 From: Moyasee Date: Fri, 31 Oct 2025 00:19:49 +0200 Subject: [PATCH] fix: linting issue, marked props as read-only --- src/renderer/src/pages/catalogue/pagination.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/renderer/src/pages/catalogue/pagination.tsx b/src/renderer/src/pages/catalogue/pagination.tsx index c41635d0..ecc2afe3 100644 --- a/src/renderer/src/pages/catalogue/pagination.tsx +++ b/src/renderer/src/pages/catalogue/pagination.tsx @@ -58,7 +58,7 @@ export function Pagination({ page, totalPages, onPageChange, -}: PaginationProps) { +}: Readonly) { const { formatNumber } = useFormat(); const [isJumpOpen, setIsJumpOpen] = useState(false); @@ -90,12 +90,12 @@ export function Pagination({ const onJumpChange = (e: ChangeEvent) => { const raw = e.target.value; - const digitsOnly = raw.replace(/\D+/g, ""); + const digitsOnly = raw.replaceAll(/\D+/g, ""); if (digitsOnly === "") { setJumpValue(""); return; } - const num = parseInt(digitsOnly, 10); + const num = Number.parseInt(digitsOnly, 10); if (Number.isNaN(num)) { setJumpValue(""); return; @@ -127,9 +127,9 @@ export function Pagination({ } if (e.key === "Enter") { - const sanitized = jumpValue.replace(/\D+/g, ""); + const sanitized = jumpValue.replaceAll(/\D+/g, ""); if (sanitized.trim() === "") return; - const parsed = parseInt(sanitized, 10); + const parsed = Number.parseInt(sanitized, 10); if (Number.isNaN(parsed)) return; const target = Math.max(1, Math.min(totalPages, parsed)); onPageChange(target);