"use client";
import Link from "next/link";
import { useEffect, useState, useTransition } from "react";
import { StreamActionLog } from "yt-dlp-transcript-common/components/StreamActionLog";
import { Button } from "yt-dlp-transcript-common/components/ui/button";
import { cancelJobAction } from "../../../../../jobs/actions";
import { ImportFileForm, RecordLiveForm } from "../../../components/LiveMediaTools";
import {
archiveOrgRefreshAction,
attachVideoMediaAction,
fetchChatAction,
playableVideoAction,
waybackRefreshAction,
type RecordsRefreshResult,
} from "../mediaToolsActions";
// "Media tools" (release 32): the video-level operations that were CLI- or
// ops-only — attach this video's file from a local archive, make a playable
// copy of its saved container, and bring the channel's Wayback or archive.org
// records up to their rules. Every one previews first where it writes.
const input = "rounded border border-border bg-card px-2 py-1 text-sm";
export function VideoMediaTools({
slug,
videoId,
saved,
wayback,
archiveOrg,
}: {
slug: string;
videoId: string;
// A source container is in the saved-video store.
saved: boolean;
// A Wayback Machine copy (wayback.json, or a web.archive.org page URL).
wayback: boolean;
// An archive.org file record.
archiveOrg: boolean;
}) {
return (
Media tools
Live chat replay
fetchChatAction(slug, videoId)}
cancelAction={cancelJobAction}
buttonLabel="Fetch live chat"
runningLabel="Fetching the chat…"
label={`Fetch live chat of ${videoId}`}
/>