"use client"; import { useActionState } from "react"; import type { Worker } from "yt-dlp-transcript-common/lib/workers"; import type { TranscriptionAppDescriptor } from "yt-dlp-transcript-common/lib/transcriptionApps"; import { saveWorkersAction, type SaveWorkersResult } from "../actions"; import { WorkersField } from "./WorkersField"; // THE PERSISTED WORKER LIST, configured beside the workers it describes. // // It was a fieldset inside the one big settings form, which is the shape slice // 3 spent a whole commit undoing: this form writes ONE block and nothing else // on this page is a form, which is what lets a save here never read another // block's checkbox as off. // // Both type imports are load-bearing as types: workers.ts reaches node:fs // through transcriptionApps.ts. The app list and the tag vocabulary are built // on the server in page.tsx and travel as props. export function WorkersConfigForm({ initial, apps, knownTags, }: { initial: Worker[]; apps: TranscriptionAppDescriptor[]; knownTags: string[]; }) { const [state, formAction, pending] = useActionState< SaveWorkersResult | undefined, FormData >(saveWorkersAction, undefined); return (
); }