import React, { useEffect, useState, useRef } from 'react'; import { Scan, Scissors, Activity, Radio, CheckCircle } from 'lucide-react'; import { getApiUrl } from '../config'; import { apiFetch } from '../lib/api'; const ProcessingAnimation = ({ media, isComplete, syncedTime, isSyncedPlaying, syncTrigger }) => { const [videoSrc, setVideoSrc] = useState(null); const [isYouTube, setIsYouTube] = useState(false); const videoRef = useRef(null); const iframeRef = useRef(null); useEffect(() => { if (!media) return; if (media.type === 'file') { const url = URL.createObjectURL(media.payload); setIsYouTube(false); setVideoSrc(url); return () => URL.revokeObjectURL(url); } else if (media.type === 'server') { // Uploaded source served from the backend (survives a page reload). // The payload is the plain /api/source/ path, because that is what // gets persisted; the signed URL is minted here, at render, so a stored // session never carries a token that has since expired. A