"use client"; import { useState, useTransition } from "react"; import { refreshChannelSnapshotAction, type RefreshSnapshotResult, } from "../../actions"; // THE CHANNEL'S "Refresh report". The regeneration runs on the serial // refresh-report queue (release 17), so the action answers within ~15 s either // way: nothing (the report is on disk; the page re-renders), `{ error }` (the // walk could not run — an unmounted drive's sentence), or `{ notice }` (still // queued: "Queued behind N report regenerations — …, job …"). Both are drawn // under the button; they used to be dropped, so a refusal showed nothing. export function RefreshSnapshotButton({ slug }: { slug: string }) { const [pending, startTransition] = useTransition(); const [result, setResult] = useState(undefined); return (
{result && "error" in result && ( {result.error} )} {result && "notice" in result && ( {result.notice} )}
); }