import Link from "next/link"; import { notFound } from "next/navigation"; import { Hourglass } from "lucide-react"; import { isSuperadmin, platformDelayOverview } from "@peppa/core"; import { Empty, Flash, Notice, PageHeader, Section } from "@/components/common"; import { LiveRefresh } from "@/components/LiveRefresh"; import { PlatformDelays } from "@/components/PlatformDelays"; import { Workspace } from "@/components/Workspace"; import { requireUser } from "@/lib/auth"; import { db } from "@/lib/db"; import { getT } from "@/lib/i18n"; export async function generateMetadata() { const t = await getT(); return { title: t("Задержки — FORGE") }; } /** PEP-209: every delay on the platform's side with the superadmin's buttons; «нужен администратор» first. */ export default async function Delays({ searchParams }: { searchParams: Promise<{ error?: string; ok?: string }> }) { const user = await requireUser(); if (!(await isSuperadmin(db, user))) notFound(); const { error, ok } = await searchParams; const t = await getT(); const all = await platformDelayOverview(db); const admin = all.filter((d) => d.exhausted); const trying = all.filter((d) => !d.exhausted); return ( {ok && {t.text(ok)}} {t("Задержки на стороне FORGE")}}> {t("Что сейчас задерживается у пользователей и почему. Владельцы видят только строку ожидания на задаче.")}{" "} {t("← Дашборд")} {all.length === 0 && {t("Задержек нет.")}} {admin.length > 0 && (
)} {trying.length > 0 && (
)}
); }