feat: UsersTable and UserCardList get Email, Display name (dash when empty), Role (new RoleBadge), Invite status and Created

This commit is contained in:
fsylvain committed 2026-09-30 02:00:46 +02:00
1 parent 153fd8719a
commit 1ece778caf
19 files changed
+485 -204

No files matched your search

+11
View File
@@ -6,6 +6,8 @@ export type UserListItem =
id: number
username: string
display_name: string
email: string
role: 'owner' | 'admin'
status: 'accepted'
created_at: string
}
@@ -13,6 +15,7 @@ export type UserListItem =
kind: 'invite'
id: number
email: string
display_name?: string
status: 'pending' | 'expired'
created_at: string
}
@@ -23,6 +26,14 @@ export function userRowKey(kind: UserListItem['kind'], id: number) {
return `${kind}-${id}`
}
export function userDisplayName(item: UserListItem) {
return item.display_name ?? ''
}
export function userRole(item: UserListItem): 'owner' | 'admin' {
return item.kind === 'user' ? item.role : 'admin'
}
export interface CreatedInvite {
id: number
kind: 'invite'