import Link from "next/link"; import { sql } from "@/db"; import { fmtDateTime } from "@/lib/utils"; import { FlagList, ReportList } from "@/components/admin/review-lists"; export default async function Review() { const reviewed = await sql`SELECT id, slug, name, quality_score AS "qualityScore", link_state AS "linkState", author, depth, updated_at AS "updatedAt" FROM tools WHERE editorial_status='reviewed' AND duplicate_of IS NULL ORDER BY quality_score DESC, name LIMIT 300`; const drafts = await sql`SELECT id, slug, name, quality_score AS "qualityScore", updated_at AS "updatedAt" FROM tools WHERE editorial_status='draft' ORDER BY updated_at DESC LIMIT 100`; const flags = await sql`SELECT key, value, updated_at AS "updatedAt" FROM settings WHERE key LIKE 'review:%' OR key LIKE 'stale:%' ORDER BY updated_at DESC`; const reports = await sql`SELECT id, tool_slug AS "toolSlug", message, contact, status, created_at AS "createdAt" FROM error_reports ORDER BY (status='open') DESC, created_at DESC LIMIT 100`; return (

Review queue

Records awaiting a publishing decision, automated flags (source changes, staleness), and public error reports.

Awaiting publication ({reviewed.length})

{reviewed.map((t) => )}{!reviewed.length && }
RecordDepthQualityLinksAuthorUpdated
{t.name} {t.slug}{t.depth}{t.qualityScore}{t.linkState}{t.author}{fmtDateTime(t.updatedAt)}
Nothing waiting.
{drafts.length > 0 &&

Drafts ({drafts.length})

}

Automated flags ({flags.length})

`review:` = official page content or canonical URL changed since last scan; `stale:` = freshness policy exceeded (pricing 90 d, review 365 d, sources 180 d).

Error reports ({reports.filter((r) => r.status === "open").length} open)

); }