This commit is contained in:
ct
2025-07-03 03:04:43 +08:00
parent 08935c8a82
commit 8dd7379089

View File

@@ -2,7 +2,7 @@ import { Button } from '@/components/ui/button';
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '@/components/ui/dialog'; import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '@/components/ui/dialog';
import { Progress } from '@/components/ui/progress'; import { Progress } from '@/components/ui/progress';
import { Textarea } from '@/components/ui/textarea'; import { Textarea } from '@/components/ui/textarea';
import { CheckCircle, Clock10Icon, Download, Droplets } from 'lucide-react'; import { Clock10Icon, Download, Droplets } from 'lucide-react';
import { useState } from 'react'; import { useState } from 'react';
const VideoDownloadModal = ({ const VideoDownloadModal = ({
@@ -68,7 +68,7 @@ const VideoDownloadModal = ({
</DialogHeader> </DialogHeader>
{!isExporting && !isComplete && ( {!isExporting && !isComplete && (
<div className="space-y-8"> <div className="space-y-4">
<div className="bg-muted/30 rounded-xl border p-6"> <div className="bg-muted/30 rounded-xl border p-6">
<div className="flex items-start gap-3"> <div className="flex items-start gap-3">
<div className="space-y-3"> <div className="space-y-3">
@@ -90,8 +90,8 @@ const VideoDownloadModal = ({
</div> </div>
</div> </div>
{nonWatermarkVideosLeft > 0 && ( <div className="space-y-3">
<div className="space-y-4"> {nonWatermarkVideosLeft > 0 && (
<Button <Button
onClick={handleExportWithoutWatermark} onClick={handleExportWithoutWatermark}
className="h-14 w-full text-base font-medium shadow-md transition-all duration-200 hover:shadow-lg" className="h-14 w-full text-base font-medium shadow-md transition-all duration-200 hover:shadow-lg"
@@ -99,26 +99,19 @@ const VideoDownloadModal = ({
> >
Export without watermark ({nonWatermarkVideosLeft} left) Export without watermark ({nonWatermarkVideosLeft} left)
</Button> </Button>
<Button )}
onClick={handleExportWithWatermark} <Button
variant="outline" onClick={handleExportWithWatermark}
className="hover:bg-muted/50 h-14 w-full border-2 bg-transparent text-base font-medium transition-all duration-200" variant="outline"
size="lg" className="hover:bg-muted/50 h-14 w-full border-2 bg-transparent text-base font-medium transition-all duration-200"
> size="lg"
Export
</Button>
</div>
)}
{/*
<div className="mb-4 flex items-center space-x-2">
<Checkbox id="show-debug" checked={showDebug} onCheckedChange={setShowDebug} />
<label
htmlFor="show-debug"
className="text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
> >
Debug FFMPEG command Export
</label> </Button>
</div> */} <Button variant="link" onClick={handleClose} className="h-8 w-full">
Close
</Button>
</div>
{showDebug && <Textarea value={ffmpegCommand} readOnly className="mb-4" />} {showDebug && <Textarea value={ffmpegCommand} readOnly className="mb-4" />}
</div> </div>
@@ -135,8 +128,7 @@ const VideoDownloadModal = ({
)} )}
</div> </div>
<div className="space-y-2"> <div className="space-y-2">
<h3 className="text-xl font-semibold">Exporting {exportType === 'without' ? 'without' : 'with'} watermark</h3> <h3 className="text-xl font-semibold">Exporting {exportType === 'without' ? 'without watermark' : 'with'}</h3>
<p className="text-muted-foreground">Please wait while we prepare your export...</p>
{exportStatus && <p className="text-muted-foreground text-sm text-wrap">{exportStatus}</p>} {exportStatus && <p className="text-muted-foreground text-sm text-wrap">{exportStatus}</p>}
</div> </div>
</div> </div>
@@ -150,28 +142,6 @@ const VideoDownloadModal = ({
</div> </div>
</div> </div>
)} )}
{isComplete && (
<div className="space-y-8 py-4">
<div className="space-y-4 text-center">
<div className="bg-muted mx-auto flex h-16 w-16 items-center justify-center rounded-full">
<CheckCircle className="h-8 w-8" />
</div>
<div className="space-y-2">
<h3 className="text-xl font-semibold">Export Complete!</h3>
<p className="text-muted-foreground">
Your video has been exported successfully {exportType === 'without' ? 'without' : 'with'} watermark.
</p>
</div>
</div>
<div className="flex justify-center">
<Button onClick={handleClose} className="h-12 w-full font-medium">
Close
</Button>
</div>
</div>
)}
</DialogContent> </DialogContent>
</Dialog> </Dialog>
); );