fix: missing key and type import

This commit is contained in:
sk1982 2024-03-31 23:29:02 -04:00
parent baf1898d23
commit 4f4a23cc2d
2 changed files with 3 additions and 2 deletions

View File

@ -146,7 +146,7 @@ export const AdminUserList = ({ users: initialUsers }: { users: AdminUser[]; })
}
{[...USER_PERMISSION_NAMES].filter(([permission]) => userEntry.permissions! & (1 << permission))
.map(([permission]) => <PermissionIcon className="w-6 h-6 ml-2" permission={permission} />)}
.map(([permission]) => <PermissionIcon className="w-6 h-6 ml-2" permission={permission} key={permission} />)}
<Spacer className="flex-grow" />

View File

@ -17,6 +17,7 @@ import { useState } from 'react';
import { useConfirmModal } from '@/components/confirm-modal';
import { useRouter } from 'next/navigation';
import { ChuniPenguinIcon } from '@/components/chuni/chuni-penguin-icon';
import { DB } from '@/types/db';
export type UserProfile<V extends boolean> = Pick<UserPayload, 'username' | 'id' | 'uuid' | 'permissions'> & Pick<DBUserPayload, 'created_date' | 'last_login_date'> & { visible: V; };
type UserFriend = Pick<DB['actaeon_user_friends'], 'chuniRival'> | null | undefined;
@ -53,7 +54,7 @@ export const UserProfile = <T extends boolean>(props: UserProfileProps<T>) => {
</Tooltip>}
<span>{props.user.username}</span>
{[...USER_PERMISSION_NAMES].filter(([permission]) => props.user.permissions! & (1 << permission))
.map(([permission]) => <PermissionIcon permission={permission} className="ml-2.5 h-7 w-7" />)}
.map(([permission]) => <PermissionIcon key={permission} permission={permission} className="ml-2.5 h-7 w-7" />)}
</div>
<div className="ml-auto flex gap-2">