1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-22 21:14:18 +00:00
pds-2021-g2-nest/nest_frontend/components/interactive/BoxUserList.js

26 lines
750 B
JavaScript
Raw Normal View History

2021-05-18 00:04:06 +00:00
import React, { useContext } from "react"
2021-05-12 02:10:36 +00:00
import Loading from "../base/Loading"
import BoxFullScrollable from "../base/BoxFullScrollable"
import SummaryUser from "./SummaryUser"
2021-05-18 00:04:06 +00:00
import ContextLanguage from "../../contexts/ContextLanguage"
2021-05-12 02:10:36 +00:00
export default function BoxUserList({ users, destroyUser, running, ...props }) {
2021-05-18 00:48:34 +00:00
const { strings } = useContext(ContextLanguage)
2021-05-18 00:04:06 +00:00
2021-05-12 02:10:36 +00:00
let contents
if(users === null) {
contents = <Loading/>
}
else {
contents = users.map(user =>
<SummaryUser key={user["email"]} destroyUser={destroyUser} running={running} user={user}/>)
}
return (
2021-05-18 00:04:06 +00:00
<BoxFullScrollable header={strings.userList} {...props}>
2021-05-12 02:10:36 +00:00
{contents}
</BoxFullScrollable>
)
}