1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-22 13:04:19 +00:00
pds-2021-g2-nest/nest_frontend/routes/PageUsers.js

23 lines
940 B
JavaScript
Raw Normal View History

2021-05-12 02:10:36 +00:00
import React from "react"
import Style from "./PageUsers.module.css"
2021-05-11 17:42:04 +00:00
import classNames from "classnames"
import BoxHeader from "../components/base/BoxHeader"
2021-05-11 21:27:42 +00:00
import BoxUserCreate from "../components/interactive/BoxUserCreate"
2021-05-12 02:10:36 +00:00
import useBackendViewset from "../hooks/useBackendViewset"
import BoxUserList from "../components/interactive/BoxUserList"
2021-05-11 17:42:04 +00:00
2021-05-11 21:27:42 +00:00
export default function PageUsers({ children, className, ...props }) {
2021-05-12 02:10:36 +00:00
const bv = useBackendViewset("/api/v1/users/", "email")
2021-05-11 21:27:42 +00:00
2021-05-11 17:42:04 +00:00
return (
2021-05-12 02:10:36 +00:00
<div className={classNames(Style.PageUsers, className)} {...props}>
2021-05-11 17:42:04 +00:00
<BoxHeader className={Style.Header}>
2021-05-11 21:27:42 +00:00
Gestisci utenti
2021-05-11 17:42:04 +00:00
</BoxHeader>
2021-05-12 02:10:36 +00:00
<BoxUserCreate className={Style.CreateUser} createUser={bv.createResource} running={bv.running}/>
<BoxUserList className={Style.UserList} users={bv.resources} destroyUser={bv.destroyResource} running={bv.running}/>
2021-05-11 17:42:04 +00:00
</div>
)
}