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