"use client"; import { useActionState } from "react"; import type { PublishSettings } from "yt-dlp-transcript-common/lib/settings"; import { Field } from "../../../components/forms/Field"; import { seedChecked, seedValue } from "../../../lib/formState"; import { savePublishSettingsAction } from "../../settingsActions"; import type { SaveResult } from "../../../settings/actions"; // `settings.publish` (release 18), every field but `held` — the hold button // beside the runner writes that one. The policies of the hub and the homepage // live here; a SITE's policy is its own (site.json `publish.auto`, set on the // site's page). const POLICIES = [ ["off", "Off"], ["build", "Build"], ["preview", "Preview"], ["production", "Production"], ] as const; function PolicySelect({ label, name, initial, state, }: { label: string; name: string; initial: string; state: SaveResult | undefined; }) { return ( ); } export function PublishSettingsForm({ initial }: { initial: PublishSettings }) { const [state, formAction, pending] = useActionState( savePublishSettingsAction, undefined, ); return (
Publish lane settings
{state?.ok === true && ( Saved. )} {state?.ok === false && ( {state.error} )}
); }