change pagination styles for file matches table
This commit is contained in:
@@ -8,6 +8,7 @@ import FilePageViolationInfo from '@/app/ui/file-page/violation-table/file-page-
|
||||
import { useFileViolations } from '@/app/hooks/react-query/useFileViolations';
|
||||
import { ViolationFileDetail } from '@/app/hooks/react-query/useFileViolations';
|
||||
import DropDownList from '@/app/components/DropDownList';
|
||||
import { IconArrowLeft, IconArrowRight } from '@/app/ui/icons/icons';
|
||||
|
||||
export default function FilePageViolationsList({
|
||||
currentPage,
|
||||
@@ -96,9 +97,6 @@ export default function FilePageViolationsList({
|
||||
<li value="AUTHORIZED_USE">{tStatus('AUTHORIZED_USE')}</li>
|
||||
</DropDownList>
|
||||
</div>
|
||||
<span>
|
||||
{t('total-violations')}: {fileViolations.total_elements} | {t('page')} {fileViolations.current_page} {t('out-of')} {fileViolations.total_pages}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -173,35 +171,48 @@ export default function FilePageViolationsList({
|
||||
<FilePageViolationInfo selectedViolation={selectedViolation} />
|
||||
|
||||
</div>
|
||||
{fileViolations.total_pages > 1 && (
|
||||
<div className="pagination">
|
||||
<button
|
||||
onClick={() => handlePageChange(currentPage - 1)}
|
||||
className="pagination-item pagination-item-prev"
|
||||
disabled={!fileViolations.has_previous}
|
||||
>
|
||||
{t('previous')}
|
||||
</button>
|
||||
|
||||
{getPageNumbers().map(pageNum => (
|
||||
<div
|
||||
className="sources-list-pagination"
|
||||
>
|
||||
<span>
|
||||
{t('total-violations')}: {fileViolations.total_elements} | {t('page')} {fileViolations.current_page} {t('out-of')} {fileViolations.total_pages}
|
||||
</span>
|
||||
{fileViolations.total_pages > 1 && (
|
||||
<div className="pagination-controls">
|
||||
<button
|
||||
key={pageNum}
|
||||
onClick={() => handlePageChange(pageNum)}
|
||||
className={`pagination-item ${currentPage === pageNum ? 'pagination-item-active' : ''}`}
|
||||
onClick={() => handlePageChange(currentPage - 1)}
|
||||
className="arrow"
|
||||
disabled={!fileViolations.has_previous}
|
||||
>
|
||||
{pageNum}
|
||||
<IconArrowLeft />
|
||||
</button>
|
||||
))}
|
||||
|
||||
<button
|
||||
onClick={() => handlePageChange(currentPage + 1)}
|
||||
className="pagination-item pagination-item-next"
|
||||
disabled={!fileViolations.has_next}
|
||||
>
|
||||
{t('next')}
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
<div
|
||||
className="pagination-controls-pages"
|
||||
>
|
||||
{getPageNumbers().map(pageNum => (
|
||||
<button
|
||||
key={pageNum}
|
||||
onClick={() => handlePageChange(pageNum)}
|
||||
/* className={`pagination-item ${currentPage === pageNum ? 'pagination-item-active' : ''}`} */
|
||||
className={currentPage === pageNum ? 'current' : 'other'}
|
||||
>
|
||||
{pageNum}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
|
||||
<button
|
||||
onClick={() => handlePageChange(currentPage + 1)}
|
||||
className="arrow"
|
||||
disabled={!fileViolations.has_next}
|
||||
>
|
||||
<IconArrowRight />
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user