mirror of
https://git.meshkee.com/Meshkee/dashboards.git
synced 2026-08-12 06:40:57 +04:30
Polish business FA layout and wire special-group keys plus SSL sync.
RTL carousels/FABs, special key+title fields, slider gallery fixes, and dashboard SSL sync agent for super-admin. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
66004a0fba
commit
672091d1f5
@@ -1,4 +1,6 @@
|
||||
import { useContext } from 'react'
|
||||
import { ChevronLeft, ChevronRight, ChevronsLeft, ChevronsRight } from 'lucide-react'
|
||||
import { LocaleContext } from '../context/LocaleContext'
|
||||
import styles from './Pagination.module.css'
|
||||
|
||||
export interface PaginationProps {
|
||||
@@ -38,6 +40,12 @@ export function Pagination({
|
||||
variant = 'default',
|
||||
className,
|
||||
}: PaginationProps) {
|
||||
const locale = useContext(LocaleContext)
|
||||
const dir =
|
||||
locale?.dir ??
|
||||
(typeof document !== 'undefined' && document.documentElement.dir === 'rtl' ? 'rtl' : 'ltr')
|
||||
const isRtl = dir === 'rtl'
|
||||
|
||||
if (totalPages <= 1) return null
|
||||
|
||||
const pages = buildPageWindow(currentPage, totalPages, siblingCount)
|
||||
@@ -49,8 +57,13 @@ export function Pagination({
|
||||
.filter(Boolean)
|
||||
.join(' ')
|
||||
|
||||
const FirstIcon = isRtl ? ChevronsRight : ChevronsLeft
|
||||
const PrevIcon = isRtl ? ChevronRight : ChevronLeft
|
||||
const NextIcon = isRtl ? ChevronLeft : ChevronRight
|
||||
const LastIcon = isRtl ? ChevronsLeft : ChevronsRight
|
||||
|
||||
return (
|
||||
<nav className={rootClass} aria-label={ariaLabel}>
|
||||
<nav className={rootClass} aria-label={ariaLabel} dir={dir}>
|
||||
<button
|
||||
type="button"
|
||||
className={styles.navBtn}
|
||||
@@ -58,7 +71,7 @@ export function Pagination({
|
||||
disabled={disabled || currentPage === 1}
|
||||
aria-label="First page"
|
||||
>
|
||||
<ChevronsLeft size={18} />
|
||||
<FirstIcon size={18} />
|
||||
</button>
|
||||
|
||||
<button
|
||||
@@ -68,7 +81,7 @@ export function Pagination({
|
||||
disabled={disabled || currentPage === 1}
|
||||
aria-label="Previous page"
|
||||
>
|
||||
<ChevronLeft size={18} />
|
||||
<PrevIcon size={18} />
|
||||
</button>
|
||||
|
||||
<div className={styles.pages}>
|
||||
@@ -94,7 +107,7 @@ export function Pagination({
|
||||
disabled={disabled || currentPage === totalPages}
|
||||
aria-label="Next page"
|
||||
>
|
||||
<ChevronRight size={18} />
|
||||
<NextIcon size={18} />
|
||||
</button>
|
||||
|
||||
<button
|
||||
@@ -104,7 +117,7 @@ export function Pagination({
|
||||
disabled={disabled || currentPage === totalPages}
|
||||
aria-label="Last page"
|
||||
>
|
||||
<ChevronsRight size={18} />
|
||||
<LastIcon size={18} />
|
||||
</button>
|
||||
</nav>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user