diff --git a/src/app/dashboard/membership/page.tsx b/src/app/dashboard/membership/page.tsx index 42d7ac6..7e07f02 100755 --- a/src/app/dashboard/membership/page.tsx +++ b/src/app/dashboard/membership/page.tsx @@ -31,8 +31,6 @@ export default async function MembershipPage({ searchParams }: MembershipPagePro ]); return ( -
- -
+ ); } diff --git a/src/components/membership/CreateUserModal.tsx b/src/components/membership/CreateUserModal.tsx index 7222004..fbdfe2f 100755 --- a/src/components/membership/CreateUserModal.tsx +++ b/src/components/membership/CreateUserModal.tsx @@ -3,6 +3,7 @@ import { useState } from 'react'; import type { Role } from '@/lib/schemas'; import { createUserAction } from '@/lib/actions/membership'; +import { GhButton } from '@/components/ui/GhButton'; interface CreateUserModalProps { roles: Role[]; @@ -44,17 +45,22 @@ export function CreateUserModal({ roles, onClose }: CreateUserModalProps) { }; return ( -
-
-

Create New User

+
+
+

Create New User

{error && ( -
{error}
+
+ {error} +
)}
-
-
-
-
- - +
diff --git a/src/components/membership/DeleteUserModal.tsx b/src/components/membership/DeleteUserModal.tsx index 06d0442..f5b2883 100755 --- a/src/components/membership/DeleteUserModal.tsx +++ b/src/components/membership/DeleteUserModal.tsx @@ -3,6 +3,7 @@ import { useState } from 'react'; import type { User } from '@/lib/schemas'; import { deleteUserAction } from '@/lib/actions/membership'; +import { GhButton } from '@/components/ui/GhButton'; interface DeleteUserModalProps { user: User; @@ -37,36 +38,29 @@ export function DeleteUserModal({ user, onClose }: DeleteUserModalProps) { }; return ( -
-
-

Delete User

+
+
+

Delete User

{error && ( -
{error}
+
+ {error} +
)} -

+

Are you sure you want to delete the user "{user.username}"? This action cannot be undone.

-
- - +
diff --git a/src/components/membership/UserManagementTable.tsx b/src/components/membership/UserManagementTable.tsx index 9500bb1..25963cb 100755 --- a/src/components/membership/UserManagementTable.tsx +++ b/src/components/membership/UserManagementTable.tsx @@ -1,12 +1,12 @@ 'use client'; import { useState } from 'react'; -import Link from 'next/link'; import { useRouter } from 'next/navigation'; import type { Role, User } from '@/lib/schemas'; import { hasPermission } from '@/lib/schemas/user'; import { CreateUserModal } from './CreateUserModal'; import { DeleteUserModal } from './DeleteUserModal'; +import { GhButton } from '@/components/ui/GhButton'; interface UserManagementTableProps { initialData: User[]; @@ -55,7 +55,7 @@ export function UserManagementTable({ initialData, roles, currentUser }: UserMan }; const getSortIcon = (field: string) => { - if (sortBy !== field) return '↕️'; + if (sortBy !== field) return '↕'; return sortDesc ? '↓' : '↑'; }; @@ -79,161 +79,137 @@ export function UserManagementTable({ initialData, roles, currentUser }: UserMan return ( <> -
-
-
- - - - - -

User Management

-
- {hasPermission(currentUser, 'membership.create') && ( - - )} + {/* Internal topbar */} +
+
+ User Management
+ {hasPermission(currentUser, 'membership.create') && ( + + + Create User + + )}
-
- {/* Filters */} -
-

Filters

-
-
- - setUsernameFilter(e.target.value)} - placeholder="Search by username..." - className="mt-1 block w-full rounded-md border border-gray-600 bg-gray-700 px-3 py-2 text-white placeholder-gray-400 focus:border-blue-500 focus:ring-1 focus:ring-blue-500 focus:outline-none" - /> -
-
- - setRoleNameFilter(e.target.value)} - placeholder="Filter by role..." - className="mt-1 block w-full rounded-md border border-gray-600 bg-gray-700 px-3 py-2 text-white placeholder-gray-400 focus:border-blue-500 focus:ring-1 focus:ring-blue-500 focus:outline-none" - /> -
+ {/* Filters */} +
+
Filters
+
+
+ + setUsernameFilter(e.target.value)} + placeholder="Search by username..." + className="form-input" + />
-
- - +
+ + setRoleNameFilter(e.target.value)} + placeholder="Filter by role..." + className="form-input" + />
+
+ + Apply + + + Reset + +
+
- {/* Results Summary */} -
Showing {initialData.length} users
+ {/* Results count */} +
Showing {initialData.length} users
- {/* Users Table */} -
- - - - + + + {initialData.length > 0 ? ( + initialData.map((user) => ( + + + + {hasPermission(currentUser, 'membership.edit') && ( + + )} + + )) + ) : ( + + + + )} + +
- + {/* Users table */} +
+ + + + + + {hasPermission(currentUser, 'membership.edit') && ( + - - {hasPermission(currentUser, 'membership.edit') && ( - - )} - - - - {initialData.length > 0 ? ( - initialData.map((user) => ( - - - - {hasPermission(currentUser, 'membership.edit') && ( - - )} - - )) - ) : ( - - - )} - -
+ + + + + Actions - - - Actions -
- {user.username} - - - {user.role.name} - - -
- - {hasPermission(currentUser, 'membership.delete') && ( - - )} -
-
- No users found -
-
- +
+ {user.username} + + + {user.role.name} + + +
+ + {hasPermission(currentUser, 'membership.delete') && ( + + )} +
+
+ No users found +
+
{/* Modals */} {showCreateModal && }