import Link from "next/link";
// What a fresh install has and lacks, gathered by app/page.tsx (server side)
// when the corpus has no channel yet. Every line is a fact about this install;
// a step already done says so rather than being left out.
export type FirstRunState = {
// Enabled local transcription workers, each with the model file it would run
// and whether that file is there.
workers: { name: string; model: string; present: boolean }[];
siteCount: number;
};
function Step({
n,
done,
title,
href,
action,
children,
}: {
n: number;
done: boolean;
title: string;
href: string;
action: string;
children?: React.ReactNode;
}) {
return (
{done ? "✓" : n}
{title}
{action}
{children &&
{children}
}
);
}
// The dashboard's first-run checklist: shown only while there is no channel.
export function FirstRunPanel({ state }: { state: FirstRunState }) {
const ready = state.workers.filter((w) => w.present);
return (
First steps
0}
title="A transcription worker with a model"
href="/workers"
action="Workers page"
>
{state.workers.length === 0
? "No transcription worker is enabled."
: state.workers.map((w) => (
{w.name}: {w.present ? "model ready" : "model missing"} — {w.model || "none named"}
))}
Sync downloads captions and audio; Transcribe covers the videos without captions.
0} title="Publish a site" href="/sites" action="Sites page">
{state.siteCount > 0
? `${state.siteCount} site${state.siteCount === 1 ? "" : "s"} configured.`
: "No site yet."}
);
}