"use client"; // RESUME A CHANNEL THE MACHINE PAUSED. // // NOT A SECOND WRITER. `settings.channelPriority` has exactly one // (`saveChannelPriorityAction`, S3), and this is the named gesture // `setChannelTierAction` reached from a different page — the same writer, one // more control. Setting the tier by hand is also what CLEARS the auto-pause // record (`clearAutoPause` in the writer), so there is nothing extra to do // here: restoring the tier and dropping the machine's note are one edit. // // IT POSTS THE PREVIOUS TIER, not "normal". The whole content of the record is // the tier the channel HAD, and resuming a `high` channel to `normal` would // silently demote it — which is the kind of thing an operator discovers three // weeks later by wondering why a lane never gets to it. // // The drive may still be away, and that is fine: the next watch pass will // auto-pause it again (and the record it writes then is a fresh one). What the // operator's word buys is that it is THEIR decision until then. // // A FAILED WRITE MUST SAY SO — the writer returns `{error}` before it // revalidates, so a swallowed result would read as "the click did nothing". import { useState, useTransition } from "react"; import type { StoredChannelTier } from "yt-dlp-transcript-common/lib/channelPriority"; import { setChannelTierAction } from "../../channels/actions"; export function ResumeAutoPausedButton({ slug, previousTier, }: { slug: string; previousTier: StoredChannelTier; }): React.ReactNode { const [pending, startTransition] = useTransition(); const [error, setError] = useState(null); return ( <> {error && ( {error} )} ); }