import { requireOperator } from "@/lib/ops/session"; import { overview } from "@/lib/ops/projections"; import { switches } from "@/lib/switches"; import Controls from "./Controls"; /* Controls: the two platform switches and the demo reset. Reads the switch row through the * product's own reader so what is shown is exactly what the sign-up route and the demo see — * the row, with the environment's override on top. */ export const dynamic = "force-dynamic"; export default async function OpsControls() { const op = await requireOperator(); const [sw, o] = await Promise.all([switches(), overview()]); const fmt = (d: Date) => d.toLocaleString("en-AU", { timeZone: "Australia/Brisbane", dateStyle: "medium", timeStyle: "short" }); return ( <>
Controls

Switches

{sw.row.updatedAt ? `Last changed ${fmt(sw.row.updatedAt)}` : "Never changed from here"} · every change is written to the trail
Platform{o.facilities} facilities · {o.live} live
Deleting a facility
Lives on the facility’s own page, at the bottom. Owner, the facility’s exact name typed, and a live code from your second factor. It cannot be undone.
); }