This commit is contained in:
ct
2025-07-15 00:50:10 +08:00
parent 8bb6705031
commit ee44a5f6fb

View File

@@ -4,10 +4,12 @@ import { Button } from '@/components/ui/button';
import { cn } from '@/lib/utils'; import { cn } from '@/lib/utils';
import { useMitt } from '@/plugins/MittContext'; import { useMitt } from '@/plugins/MittContext';
import useVideoEditorStore from '@/stores/VideoEditorStore'; import useVideoEditorStore from '@/stores/VideoEditorStore';
import { Download, Play, Square, SquarePen } from 'lucide-react'; import useMediaStore from '@/stores/MediaStore';
import { Download, Play, Square, SquarePen, RefreshCw } from 'lucide-react';
const EditorControls = ({ className = '', onEditClick = () => {}, isEditActive = false }) => { const EditorControls = ({ className = '', onEditClick = () => {}, isEditActive = false }) => {
const { videoIsPlaying } = useVideoEditorStore(); const { videoIsPlaying } = useVideoEditorStore();
const { init } = useMediaStore();
const emitter = useMitt(); const emitter = useMitt();
const handlePlay = () => { const handlePlay = () => {
@@ -26,6 +28,11 @@ const EditorControls = ({ className = '', onEditClick = () => {}, isEditActive =
emitter.emit('open-ai-editor-sheet'); emitter.emit('open-ai-editor-sheet');
}; };
const handleRefresh = () => {
handleReset();
init();
};
const togglePlayPause = () => { const togglePlayPause = () => {
if (videoIsPlaying) { if (videoIsPlaying) {
handleReset(); handleReset();
@@ -58,6 +65,10 @@ const EditorControls = ({ className = '', onEditClick = () => {}, isEditActive =
<SquarePen className={`h-8 w-8 ${isEditActive ? 'text-white' : ''}`} /> <SquarePen className={`h-8 w-8 ${isEditActive ? 'text-white' : ''}`} />
</Button> </Button>
<Button onClick={handleRefresh} variant="outline" size="icon" className="h-12 w-12 rounded-full border shadow-sm">
<RefreshCw className="h-8 w-8" />
</Button>
<Button onClick={handleDownloadButton} variant="outline" size="icon" className="h-12 w-12 rounded-full border shadow-sm"> <Button onClick={handleDownloadButton} variant="outline" size="icon" className="h-12 w-12 rounded-full border shadow-sm">
<Download className="h-8 w-8" /> <Download className="h-8 w-8" />
</Button> </Button>