import { Button } from '@/components/ui/button'; import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '@/components/ui/dialog'; import { Progress } from '@/components/ui/progress'; import { Textarea } from '@/components/ui/textarea'; import { Clock10Icon, Download, Droplets } from 'lucide-react'; import { useState } from 'react'; const VideoDownloadModal = ({ nonWatermarkVideosLeft = 0, isOpen, onClose, ffmpegCommand, handleDownloadButton, isExporting, exportProgress, exportStatus, }) => { const [showDebug, setShowDebug] = useState(false); const [exportType, setExportType] = useState(null); const handleExportWithoutWatermark = () => { setExportType('without'); handleDownloadButton(); }; const handleExportWithWatermark = () => { setExportType('with'); handleDownloadButton(); }; const handleClose = () => { onClose(); setTimeout(() => { setExportType(null); }, 300); }; const isComplete = exportProgress >= 100 && !isExporting; const exportTimes = [ { icon: '🐇', label: 'Modern and fast devices', time: '1-2 mins', }, { icon: '🐢', label: 'Medium range devices', time: '3-5 mins', }, { icon: '🥔', label: 'Older / potato devices', time: '>5 mins', }, ]; return ( isExporting && e.preventDefault()} onEscapeKeyDown={(e) => isExporting && e.preventDefault()} > Export Video {!isExporting && !isComplete && (

Estimated export time

{exportTimes.map((exportTime, index) => (
{exportTime.icon} {exportTime.label}
{exportTime.time}
))}
{nonWatermarkVideosLeft > 0 && ( )}
{showDebug &&