import { auth } from "@/auth"; import { listLibrary } from "@/lib/library"; import { listLocalFolders } from "@/lib/local-folders"; import { getWorkerStatus } from "@/lib/worker-status"; import { LibraryTop } from "./library-top"; import { LibraryView } from "./library-view"; export const dynamic = "force-dynamic"; export default async function LibraryPage({ searchParams }: PageProps<"/">) { const [rows, worker, folders, session] = await Promise.all([listLibrary(), getWorkerStatus(), listLocalFolders(), auth()]); return (
{/* The form opens by default while the library is empty and there's nothing on disk to import, and with ?add=1 (the ⌘K palette's "Add model"). */} s + r.presentBytes, 0), updates: rows.filter((r) => r.updateAvailable && (r.hubState === "available" || !r.hubState)).length, goneFromHub: rows.filter((r) => r.hubState === "repo_missing" || r.hubState === "commit_missing").length, }} panel={{ freeBytes: worker.online ? worker.modelsDirFreeBytes : null, folders }} /> {rows.length > 0 && }
); }