"use client"; import { useActionState } from "react"; import type { ActionResult } from "../actions"; import { SeededInput } from "../../components/forms/Field"; type Props = { slug: string; action: ( prev: ActionResult, formData: FormData, ) => Promise; // Why the delete is refused right now, or null. Same shape and same reason as // the rename form's: the action is the guard, this is the earlier warning. busyReason?: string | null; }; export function DeleteChannelForm({ slug, action, busyReason = null }: Props) { const [state, formAction] = useActionState( action, undefined, ); return (

Deleting will remove transcripts/channels/{slug}/ and all downloaded videos. Type the slug to confirm.

{busyReason && (

{busyReason}

)}
{state?.error && (

{state.error}

)}
); }