aboutsummaryrefslogtreecommitdiff
path: root/src/pages/Index.jsx
blob: 1ae9fd14b182465814d585d92eb894ab3212b08d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import Card from "../components/Card";
import "./Index.css";

const Index = (props) => {
    const response = props.response;
    if (response.loading) {
        return <div>Loading...</div>;
    }

    const data = response.data;

    const latest = data[data.length - 1];

    return (
        <div>
            <div>
                <div className="Message">
                    This site shows data from the 2021 Fall and 2022 Spring semesters. For the latest data, visit{" "}
                    <a href="https://ritcoviddashboard.com/">ritcoviddashboard.com</a>
                </div>
            </div>
            <div className="Section" id="total">
                <div className="Title">Total Positive Cases Since August 24 (First Day of Classes)</div>
                <div className="Cards">
                    <Card name="Students" link="/totalstudents" latest={latest["total_students"]} />
                    <Card name="Staff" link="/totalstaff" latest={latest["total_staff"]} />
                </div>
            </div>

            <div className="Section" id="new">
                <div className="Title">New Positive Cases From Past 14 Days</div>
                <div className="Cards">
                    <Card name="Students" link="/newstudents" latest={latest["new_students"]} />
                    <Card name="Staff" link="/newstaff" latest={latest["new_staff"]} />
                </div>
            </div>
        </div>
    );
};

export default Index;