import { notFound } from "next/navigation"; import { getPaths } from "yt-dlp-transcript-common/lib/paths"; import { listChannelConfigs } from "yt-dlp-transcript-common/controller/channels"; import { listSites } from "yt-dlp-transcript-common/lib/site"; import { SiteForm, type ChannelOption, type SiteOption, } from "../components/SiteForm"; import { getSiteCached } from "./lib/siteCache"; export const dynamic = "force-dynamic"; export default async function EditSitePage({ params, }: { params: Promise<{ siteId: string }>; }) { const { siteId } = await params; const paths = getPaths(); const site = getSiteCached(siteId); if (!site) notFound(); const channels: ChannelOption[] = (await listChannelConfigs(paths)).map((c) => ({ slug: c.slug, name: c.config.name ?? c.slug, })); const allSites: SiteOption[] = listSites(paths) .filter((s) => s.siteId !== siteId) .map((s) => ({ siteId: s.siteId, siteTitle: s.siteTitle })); return (
); }