import Link from "next/link"; import type { ProjectSummary } from "@/lib/project-types"; import { SOURCES_STALE_DAYS } from "@/lib/dashboard"; import CheckSourcesButton from "./CheckSourcesButton"; import Panel from "./Panel"; // The long-form problem, on the front door: which projects have sources nobody // has checked, checked too long ago, or known to be dead. All of it read from // each project's summary attributes -- never probed here. export default function SourcesPanel({ never, old, bad, }: { never: ProjectSummary[]; old: ProjectSummary[]; bad: ProjectSummary[]; }) { const List = ({ items, attr }: { items: ProjectSummary[]; attr: string }) => ( ); const recheck = [...never, ...old].map((p) => p.id); return (
{never.length} never checked {old.length} older than {SOURCES_STALE_DAYS} d {bad.length}{" "} with dead or missing sources
{bad.length > 0 && } {never.length > 0 && ( <>
never checked
)} {old.length > 0 && ( <>
older than {SOURCES_STALE_DAYS} d
)} {!never.length && !old.length && !bad.length && (

every source was checked recently and is reachable

)}
); }