diff --git a/src/features/admin/pages/RolesPage.client.js b/src/features/admin/pages/RolesPage.client.js index 4bff4bf..0f6f985 100644 --- a/src/features/admin/pages/RolesPage.client.js +++ b/src/features/admin/pages/RolesPage.client.js @@ -24,14 +24,13 @@ const RolesPageClient = () => { style={{ backgroundColor: role.color || '#6b7280' }} />
-
{role.name}
+
+ {role.name} +
{role.description && (
{role.description}
)}
- {role.is_system && ( - Système - )} ), skeleton: { height: 'h-4', width: '60%' } @@ -54,6 +53,13 @@ const RolesPageClient = () => { ), skeleton: { height: 'h-4', width: '40px' } }, + { + key: 'is_system', + label: 'Système', + sortable: false, + render: (role) => role.is_system ? système : null, + skeleton: { height: 'h-4', width: '60px' } + }, { key: 'actions', label: '', diff --git a/src/shared/components/Badge.js b/src/shared/components/Badge.js index 5975dc3..682dc58 100644 --- a/src/shared/components/Badge.js +++ b/src/shared/components/Badge.js @@ -5,14 +5,14 @@ import React from 'react'; const Badge = ({ children, variant = 'default', - size = 'md', + size = 'sm', className = '', ...props }) => { - const baseClassName = 'inline-flex items-center font-medium border'; + const baseClassName = 'inline-flex items-center font-medium border font-ibm-plex-mono'; const variants = { - default: 'bg-neutral-200/80 text-neutral-700 border-neutral-300 dark:bg-neutral-500/10 dark:text-neutral-400 dark:border-neutral-500/20', + default: 'bg-neutral-100 text-neutral-700 border-neutral-200 dark:bg-neutral-500/10 dark:text-neutral-400 dark:border-neutral-500/20', primary: 'bg-blue-100 text-blue-700 border-blue-200 dark:bg-blue-500/10 dark:text-blue-400 dark:border-blue-500/20', success: 'bg-green-100 text-green-700 border-green-200 dark:bg-green-500/10 dark:text-green-400 dark:border-green-500/20', warning: 'bg-yellow-100 text-yellow-700 border-yellow-200 dark:bg-yellow-500/10 dark:text-yellow-400 dark:border-yellow-500/20', @@ -24,8 +24,8 @@ const Badge = ({ }; const sizes = { - sm: 'px-2 py-0.5 rounded-lg text-[12px]', - md: 'px-2.5 py-0.5 rounded-lg text-[12px]', + sm: 'px-[8px] py-[2px] rounded-lg text-[11px]', + md: 'px-[8px] py-[2px] rounded-lg text-[11px]', lg: 'px-3 py-1 rounded-lg text-xs' }; diff --git a/src/shared/components/Pagination.js b/src/shared/components/Pagination.js deleted file mode 100644 index 5efd4bb..0000000 --- a/src/shared/components/Pagination.js +++ /dev/null @@ -1,158 +0,0 @@ -'use client'; - -import React from 'react'; -import Button from './Button'; -import { Skeleton } from './LoadingState'; - -const Pagination = ({ - currentPage = 1, - totalPages = 1, - onPageChange, - onLimitChange, - limit = 20, - total = 0, - loading = false, - showPerPage = true, - showStats = true, - className = '', - ...props -}) => { - // Generate page numbers with ellipsis - const getPageNumbers = () => { - const pages = []; - const delta = 2; - - if (totalPages > 0) pages.push(1); - if (currentPage - delta > 2) pages.push('...'); - - for (let i = Math.max(2, currentPage - delta); i <= Math.min(totalPages - 1, currentPage + delta); i++) { - pages.push(i); - } - - if (currentPage + delta < totalPages - 1) pages.push('...'); - if (totalPages > 1) pages.push(totalPages); - - return pages; - }; - - const PaginationButton = ({ onClick, disabled, children, isActive = false }) => ( - - ); - - if (totalPages <= 1 && !showPerPage && !loading) return null; - - const from = total > 0 ? (currentPage - 1) * limit + 1 : 0; - const to = Math.min(currentPage * limit, total); - - return ( -
-
- - {/* Per Page Selector */} - {showPerPage ? ( -
- {loading ? ( - - ) : ( - <> - Afficher - - - )} -
- ) :
} - - {/* Pagination Controls */} -
- {loading ? ( - <> - -
- {Array.from({ length: 3 }).map((_, i) => ( - - ))} -
- - - ) : ( - <> - {totalPages > 1 && ( - - )} - - {totalPages > 1 && ( -
- {getPageNumbers().map((page, index) => ( - - {page === '...' ? ( - - ) : ( - onPageChange(page)} - isActive={currentPage === page} - > - {page} - - )} - - ))} -
- )} - - {totalPages > 1 && ( - - )} - - )} -
- - {/* Stats */} - {showStats ? ( -
- {loading ? ( - - ) : ( - `${from}–${to} sur ${total}` - )} -
- ) :
} -
-
- ); -}; - -export default Pagination; \ No newline at end of file