import { useNavigate } from "react-router-dom"; import { useEffect, useState } from "react"; import { getTimeOfDay } from "../utilities"; import { retrieveUserInformation } from "../security/users"; import UserProfilePicture from "../components/UserProfilePicture"; import { Button, Card } from "@nextui-org/react"; import { PencilSquareIcon } from "../icons"; import EcoconnectFullLogo from "../components/EcoconnectFullLogo"; export default function AdministratorSpringboard() { const navigate = useNavigate(); let accessToken = localStorage.getItem("accessToken"); if (!accessToken) { navigate("/signin"); } const [userInformation, setUserInformation] = useState(); let timeOfDay = getTimeOfDay(); let greeting = ""; if (timeOfDay === 0) { greeting = "Good morning"; } else if (timeOfDay === 1) { greeting = "Good afternoon"; } else if (timeOfDay === 2) { greeting = "Good evening"; } useEffect(() => { retrieveUserInformation() .then((response) => { if (response.accountType != 2) { navigate("/"); } setUserInformation(response); }) .catch(() => { navigate("/signin"); }); return; }, []); return (
{userInformation && (

{greeting}, {userInformation.firstName}.

A staff member of

{userInformation.email}

} onPress={() => { navigate("/manage-account"); }} > Manage your account

Statistics Overview

User Count

(past 30 days)

Total: 2139 users

{/* TODO: Graph */}

GRAPH HERE

Population Distribution

{/* TODO: Graph */}

GRAPH HERE

)} ); }