2021-05-11 21:27:42 +00:00
|
|
|
import React, { useContext } from "react"
|
2021-05-11 17:42:04 +00:00
|
|
|
import Style from "./PageDashboard.module.css"
|
|
|
|
import classNames from "classnames"
|
|
|
|
import BoxHeader from "../components/base/BoxHeader"
|
2021-05-11 21:27:42 +00:00
|
|
|
import BoxUserCreate from "../components/interactive/BoxUserCreate"
|
|
|
|
import ContextUser from "../contexts/ContextUser"
|
|
|
|
import BoxAlert from "../components/base/BoxAlert"
|
2021-05-11 17:42:04 +00:00
|
|
|
|
|
|
|
|
2021-05-11 21:27:42 +00:00
|
|
|
export default function PageUsers({ children, className, ...props }) {
|
|
|
|
const { user } = useContext(ContextUser)
|
|
|
|
|
|
|
|
if(!user.isAdmin) {
|
|
|
|
return (
|
|
|
|
<BoxAlert color={"Red"}>
|
|
|
|
Non sei un amministratore, pertanto non puoi gestire gli utenti della piattaforma.
|
|
|
|
</BoxAlert>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2021-05-11 17:42:04 +00:00
|
|
|
return (
|
|
|
|
<div className={classNames(Style.PageHome, className)} {...props}>
|
|
|
|
<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-11 21:27:42 +00:00
|
|
|
<BoxUserCreate/>
|
2021-05-11 17:42:04 +00:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|