- {Array.from({ length: scrollState.totalPages }, (_, pageIndex) => (
-
handlePageClick(pageIndex)}
- style={{
- cursor: 'pointer',
- borderRadius: '8px',
- padding: '8px',
- backgroundColor: scrollState.currentPage === pageIndex + 1
- ? 'var(--color-primary-100)'
- : 'transparent',
- border: scrollState.currentPage === pageIndex + 1
- ? '2px solid var(--color-primary-500)'
- : '2px solid transparent',
- transition: 'all 0.2s ease',
- display: 'flex',
- flexDirection: 'column',
- alignItems: 'center',
- gap: '8px'
- }}
- onMouseEnter={(e) => {
- if (scrollState.currentPage !== pageIndex + 1) {
- e.currentTarget.style.backgroundColor = 'var(--hover-bg)';
- }
- }}
- onMouseLeave={(e) => {
- if (scrollState.currentPage !== pageIndex + 1) {
- e.currentTarget.style.backgroundColor = 'transparent';
- }
- }}
- >
- {/* Thumbnail Image */}
- {thumbnails[pageIndex] && thumbnails[pageIndex] !== 'error' ? (
-
- ) : thumbnails[pageIndex] === 'error' ? (
-
- Failed
-
- ) : (
-
- Loading...
-
- )}
-
- {/* Page Number */}
-
- Page {pageIndex + 1}
-
-
- ))}
-
-