From 854f439bf972bac71bcf94cb956381eb2a365fca Mon Sep 17 00:00:00 2001 From: Amirhossein Khalili Date: Sun, 24 May 2026 21:28:03 +0330 Subject: [PATCH] fix(pagination): remove floating style from pagination component --- src/components/Pagination.tsx | 68 +++++++++++++++++------------------ 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/src/components/Pagination.tsx b/src/components/Pagination.tsx index 28e9a00..cc53059 100644 --- a/src/components/Pagination.tsx +++ b/src/components/Pagination.tsx @@ -4,33 +4,33 @@ import { useTranslation } from '../hooks/useTranslation'; import { cn } from '../lib/utils'; import { Select } from './ui/Select'; import { Button } from './ui/button'; - -interface PaginationProps { - currentPage: number; - totalCount: number; - limit: number; - onPageChange: (page: number) => void; - onLimitChange: (limit: number) => void; - pageSizeOptions?: number[]; -} - + +interface PaginationProps { + currentPage: number; + totalCount: number; + limit: number; + onPageChange: (page: number) => void; + onLimitChange: (limit: number) => void; + pageSizeOptions?: number[]; +} + export const Pagination: React.FC = ({ - currentPage, - totalCount, - limit, - onPageChange, - onLimitChange, - pageSizeOptions = [10, 20, 50], -}) => { - const { t, lang } = useTranslation(); - const isFa = lang === 'fa'; - - const toPersianNum = (num: string | number | undefined | null) => { - if (num === null || num === undefined) return num; - if (!isFa) return num; - return num.toString().replace(/\d/g, d => '۰۱۲۳۴۵۶۷۸۹'[d as any]); - }; - + currentPage, + totalCount, + limit, + onPageChange, + onLimitChange, + pageSizeOptions = [10, 20, 50], +}) => { + const { t, lang } = useTranslation(); + const isFa = lang === 'fa'; + + const toPersianNum = (num: string | number | undefined | null) => { + if (num === null || num === undefined) return num; + if (!isFa) return num; + return num.toString().replace(/\d/g, d => '۰۱۲۳۴۵۶۷۸۹'[d as any]); + }; + const totalPages = Math.ceil(totalCount / limit) || 1; if (totalCount === 0) return null; @@ -63,8 +63,8 @@ export const Pagination: React.FC = ({ }, [currentPage, totalPages]); return ( -
-
+
+