import { motion } from 'framer-motion'; import { getClipDownloadUrl } from '../api/client'; export default function DownloadGrid({ sessionId, clips }) { const completedClips = clips.filter(c => c.status === 'done'); const failedClips = clips.filter(c => c.status === 'error'); const downloadAll = () => { // Download each clip completedClips.forEach((clip, i) => { setTimeout(() => { const link = document.createElement('a'); link.href = getClipDownloadUrl(clip.clip_id); link.download = `viral_clip_${i + 1}.mp4`; document.body.appendChild(link); link.click(); document.body.removeChild(link); }, i * 1000); // Stagger downloads }); }; return (
{completedClips.length} clip{completedClips.length !== 1 ? 's' : ''} generated successfully {failedClips.length > 0 && ` • ${failedClips.length} failed`}