1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-25 06:24:19 +00:00
pds-2021-g2-nest/nest_frontend/components/interactive/BoxUserList.js
2021-05-18 02:48:34 +02:00

25 lines
750 B
JavaScript

import React, { useContext } from "react"
import Loading from "../base/Loading"
import BoxFullScrollable from "../base/BoxFullScrollable"
import SummaryUser from "./SummaryUser"
import ContextLanguage from "../../contexts/ContextLanguage"
export default function BoxUserList({ users, destroyUser, running, ...props }) {
const { strings } = useContext(ContextLanguage)
let contents
if(users === null) {
contents = <Loading/>
}
else {
contents = users.map(user =>
<SummaryUser key={user["email"]} destroyUser={destroyUser} running={running} user={user}/>)
}
return (
<BoxFullScrollable header={strings.userList} {...props}>
{contents}
</BoxFullScrollable>
)
}