import useSWR from "swr";
import { DateTime } from "luxon";
import Card from "./Card";
import "./App.css";
const url = "https://rcpoller.galenguyer.com/api/v0/history";
function App() {
const { data: data, error: error } = useSWR(url);
if (error)
return (
RIT Covid Dashboard
An error occurred
);
if (!data)
return (
RIT Covid Dashboard
Loading latest data...
);
const latest = data[data.length - 1];
const prior = data[data.length - 2];
const local = DateTime.local().zoneName;
const lastUpdate = DateTime.fromSQL(latest.last_updated, { zone: "UTC" }).setZone(local);
return (
RIT Covid Dashboard
Last Updated:{" "}
{lastUpdate.toLocaleString({
weekday: "long",
month: "long",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
})}
Total Positive Cases Since August 19 (First Day of Classes)
New Positive Cases From Past 14 Days
Number of Students in Quarantine
Quarantine separates and restricts the movement of people who were exposed to a contagious disease
to see if they become sick.
Number of Students in Isolation
Isolation separates sick people with a contagious disease from people who are not sick.
Number of Tests Administered by Student Health Center
Quarantine/Isolation Bed Availability On-campus
);
}
export default App;