/**
 * /admin/batch — live batch-rebuild progress monitor.
 *
 * Auto-refreshes every 30s while the batch is running.
 */
import Link from "next/link";
import { AuthBar } from "@/components/auth-bar";
import { BatchMonitor } from "@/components/batch-monitor";
import { IndexerStatus } from "@/components/indexer-status";

export const dynamic = "force-dynamic";

export default function AdminBatchPage() {
  return (
    <main className="min-h-screen p-6 md:p-10 max-w-5xl mx-auto">
      <div className="flex items-start justify-between gap-4 mb-6">
        <Link href="/" className="font-mono text-xs text-[#7fdbff] hover:text-[#00ff9c]">
          ← home
        </Link>
        <AuthBar />
      </div>

      <header className="mb-6">
        <div className="font-mono text-[10px] text-[#5a6678] tracking-widest uppercase mb-2">
          admin · batch rebuild monitor
        </div>
        <h1 className="font-mono text-2xl text-[#00ff9c] mb-1">▍ chunks rebuild progress</h1>
        <p className="text-[#8896aa] text-sm">
          scripts/28-batch-rebuild-all.py · 2 workers · 1 doc per fresh subprocess (clean context)
        </p>
      </header>

      <BatchMonitor />

      <hr className="my-10 border-[rgba(0,255,156,0.15)]" />

      <IndexerStatus />
    </main>
  );
}
