Small fix to props and imports
This commit is contained in:
		
							parent
							
								
									cc231dbfaa
								
							
						
					
					
						commit
						b20817ec8a
					
				
					 1 changed files with 4 additions and 12 deletions
				
			
		|  | @ -1,14 +1,6 @@ | |||
| import { useState } from "react"; | ||||
| import { PublicUser } from "../Types/goTypes"; | ||||
| import UserInfoModal from "./UserInfoModal"; | ||||
| 
 | ||||
| /** | ||||
|  * The props for the UserProps component | ||||
|  */ | ||||
| interface UserProps { | ||||
|   users: PublicUser[]; | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * A list of users for admin manage users page, that sets an onClick | ||||
|  * function for eact user <li> element, which displays a modul with | ||||
|  | @ -20,7 +12,7 @@ interface UserProps { | |||
|  * return <UserList users={users} />; | ||||
|  */ | ||||
| 
 | ||||
| export function UserListAdmin(props: UserProps): JSX.Element { | ||||
| export function UserListAdmin(props: { users: string[] }): JSX.Element { | ||||
|   const [modalVisible, setModalVisible] = useState(false); | ||||
|   const [username, setUsername] = useState(""); | ||||
| 
 | ||||
|  | @ -46,12 +38,12 @@ export function UserListAdmin(props: UserProps): JSX.Element { | |||
|           {props.users.map((user) => ( | ||||
|             <li | ||||
|               className="pt-5" | ||||
|               key={user.userId} | ||||
|               key={user} | ||||
|               onClick={() => { | ||||
|                 handleClick(user.username); | ||||
|                 handleClick(user); | ||||
|               }} | ||||
|             > | ||||
|               {user.username} | ||||
|               {user} | ||||
|             </li> | ||||
|           ))} | ||||
|         </ul> | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Peter KW
						Peter KW