import type { Metadata } from "next"; import Link from "next/link"; import { getPaths } from "yt-dlp-transcript-common/lib/paths"; import { listChannelConfigs } from "yt-dlp-transcript-common/controller/channels"; import { DEFAULT_GROUP_FALLBACK_ID, FALLBACK_GROUP, } from "yt-dlp-transcript-common/lib/channelGroups"; import { listSites, type Site } from "yt-dlp-transcript-common/lib/site"; import { SiteForm, type ChannelOption, type SiteOption, } from "../components/SiteForm"; export const dynamic = "force-dynamic"; export const metadata: Metadata = { title: "New site — Sites" }; export default async function NewSitePage() { const paths = getPaths(); const channels: ChannelOption[] = (await listChannelConfigs(paths)).map((c) => ({ slug: c.slug, name: c.config.name ?? c.slug, })); const allSites: SiteOption[] = listSites(paths).map((s) => ({ siteId: s.siteId, siteTitle: s.siteTitle, })); const blank: Site = { siteId: "", siteTitle: "", siteDescription: "", headerTitle: "", homeTagline: "", // socialLinks omitted = inherit the global default. groups: [{ ...FALLBACK_GROUP }], defaultGroupId: DEFAULT_GROUP_FALLBACK_ID, channels: [], }; return (
Sites / new

New site

); }