feat: avatar column in admin users table
This commit is contained in:
@@ -2,6 +2,9 @@ export type AdminUser = {
|
||||
id: string
|
||||
email: string
|
||||
name: string | null
|
||||
avatar?: string | null
|
||||
avatarType?: string | null
|
||||
avatarStyle?: string | null
|
||||
createdAt: string
|
||||
updatedAt: string
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import { $user } from '@/shared/model/auth'
|
||||
import { AdminDialog } from '@/shared/ui/AdminDialog/AdminDialog'
|
||||
import { AdminTable } from '@/shared/ui/AdminTable'
|
||||
import { EntityRowActions } from '@/shared/ui/EntityRowActions'
|
||||
import { UserAvatar } from '@/shared/ui/UserAvatar'
|
||||
|
||||
type UserFormState = {
|
||||
email: string
|
||||
@@ -171,6 +172,7 @@ export function AdminUsersPage() {
|
||||
|
||||
<AdminTable
|
||||
columns={[
|
||||
{ key: 'avatar', label: 'Аватар' },
|
||||
{ key: 'email', label: 'Почта' },
|
||||
{ key: 'name', label: 'Имя' },
|
||||
{ key: 'createdAt', label: 'Создан' },
|
||||
@@ -182,13 +184,22 @@ export function AdminUsersPage() {
|
||||
>
|
||||
{users.length === 0 && !usersQuery.isLoading ? (
|
||||
<TableRow>
|
||||
<TableCell colSpan={5} sx={{ color: 'text.secondary' }}>
|
||||
<TableCell colSpan={6} sx={{ color: 'text.secondary' }}>
|
||||
Пользователей пока нет.
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
) : (
|
||||
users.map((u) => (
|
||||
<TableRow key={u.id} hover>
|
||||
<TableCell>
|
||||
<UserAvatar
|
||||
userId={u.id}
|
||||
avatarUrl={u.avatar}
|
||||
avatarType={u.avatarType}
|
||||
avatarStyle={u.avatarStyle}
|
||||
size={28}
|
||||
/>
|
||||
</TableCell>
|
||||
<TableCell>{u.email}</TableCell>
|
||||
<TableCell>{u.name ?? '—'}</TableCell>
|
||||
<TableCell>{formatDt(u.createdAt)}</TableCell>
|
||||
|
||||
Reference in New Issue
Block a user