import { MainLayout } from "@components/layouts/main.tsx"; import { Handlers, PageProps } from "$fresh/server.ts"; import { getPerformances, PerformancePoint, PerformanceRes, } from "@lib/cache/performance.ts"; import { AccessDeniedError } from "@lib/errors.ts"; export const handler: Handlers = { async GET(_, ctx) { const performances = await getPerformances(); if (!("session" in ctx.state)) { throw new AccessDeniedError(); } return ctx.render({ performances }); }, }; function PerformanceLine( { maximum, data: [amount, min, average, max], url }: { maximum: number; url: string; data: readonly [number, number, number, number]; }, ) { return (