This commit is contained in:
ct
2025-06-21 22:27:55 +08:00
parent 69f3a57fb3
commit f8dc4c01f2

View File

@@ -1,10 +1,13 @@
import { Button } from '@/components/ui/button';
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog';
import { Checkbox } from '@/components/ui/checkbox';
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '@/components/ui/dialog';
import { Spinner } from '@/components/ui/spinner';
import { Textarea } from '@/components/ui/textarea';
import { useState } from 'react';
const VideoDownloadModal = ({ isOpen, onClose, ffmpegCommand, handleDownloadButton, isExporting, exportProgress, exportStatus }) => {
const debug = true;
const [showDebug, setShowDebug] = useState(false);
return (
<Dialog open={isOpen} onOpenChange={onClose}>
<DialogContent>
@@ -24,7 +27,17 @@ const VideoDownloadModal = ({ isOpen, onClose, ffmpegCommand, handleDownloadButt
))}
</DialogHeader>
{debug && <Textarea value={ffmpegCommand} readOnly />}
<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
</label>
</div>
{showDebug && <Textarea value={ffmpegCommand} readOnly className="mb-4" />}
<Button onClick={handleDownloadButton}>{isExporting ? <Spinner className="text-secondary h-4 w-4" /> : 'Download'}</Button>