'use client' import Link from 'next/link'; import FilePageViolationInfo from '@/app/ui/file-page/violation-table/file-page-violation-info'; import DropDownList from '@/app/components/DropDownList'; import { IconArrowLeft, IconArrowRight, IconDoubleArrowLeft, IconDoubleArrowRight } from '@/app/ui/icons/icons'; import { useTranslations } from 'next-intl'; export default function FilePageViolationsLoadingList({ currentPage, fileId, status, cachedTotalPages, cachedTotalElements, cachedCurrentPage, }: { currentPage: number, fileId: string, status: string | undefined, cachedTotalPages: number | undefined, cachedTotalElements: number | undefined, cachedCurrentPage: number | undefined }) { const t = useTranslations('Global'); const tStatus = useTranslations('Match-status'); const getPageNumbers = () => { const pages = []; const maxVisible = 5; const total = cachedTotalPages; let start = Math.max(1, currentPage - Math.floor(maxVisible / 2)); let end = Math.min(total ? total : 0, start + maxVisible - 1); if (end - start + 1 < maxVisible) { start = Math.max(1, end - maxVisible + 1); } for (let i = start; i <= end; i++) { pages.push(i); } return pages; }; return (