"use client"; import Link from "next/link"; import { StorageMeter, type Storage } from "@/admin/media"; import { Loading, Notice, Panel, Title, useAdmin, when } from "@/admin/ui"; type Overview = { pending: number; lastPublished: { number: number; at: string } | null; storage: Storage; colourNotes: string[]; checklist: { key: string; label: string; done: boolean; href: string | null }[]; recent: { at: string; who: string; action: string; detail: string | null }[]; }; /** The dashboard (§10): the setup checklist, what's waiting to be published, storage. */ export default function Dashboard() { const { data, error } = useAdmin("/overview"); if (!data) return ; return ( <> Dashboard
    {data.checklist.map((c) => (
  1. {c.href ? {c.label} : c.label} {c.done ? "(done)" : "(to do)"}
  2. ))}
{data.pending ? (

{data.pending} {data.pending === 1 ? "change" : "changes"}. Review and publish

) :

Nothing: the site shows everything you've done.

}
{data.recent.length === 0 ?

None yet.

: (
    {data.recent.map((e, i) =>
  • {e.who} {e.action.charAt(0).toLowerCase() + e.action.slice(1)}{e.detail && <>: {e.detail}} ({when(e.at)})
  • )}
)}
{data.colourNotes.length > 0 && (

About your colours

    {data.colourNotes.map((n) =>
  • {n}
  • )}
)}
); }