export const name = "Study Island"; export const url = "https://status.edmentum.com/"; // Study Island is a component on Edmentum's parent status page. const STATUS_URL = "https://status.edmentum.com/api/v2/summary.json"; const STATUS_MAP = { operational: "operational", degraded_performance: "degraded", partial_outage: "degraded", major_outage: "outage", }; export async function checkStatus() { const res = await fetch(STATUS_URL); if (!res.ok) { throw new Error(`Edmentum status request failed (${res.status})`); } const data = await res.json(); const component = (data.components ?? []).find( (c) => c.name === "Study Island" ); if (!component) { throw new Error("Study Island component not found in Edmentum status feed."); } const status = STATUS_MAP[component.status] ?? "unknown"; const incidents = data.incidents ?? []; const activeIncidents = incidents.filter((i) => i.status !== "resolved"); let message; if (activeIncidents.length > 0) { message = activeIncidents.map((i) => i.name).join("; "); } else { message = component.status === "operational" ? "All Systems Operational" : component.status.replace(/_/g, " "); } return { name, status, message, lastUpdated: new Date().toISOString(), }; }