forked from 77media/video-flow
新增模式状态管理,优化暂停/播放按钮逻辑,添加“下一步”按钮以支持手动模式。
This commit is contained in:
parent
2132805acd
commit
05df45fa62
@ -10,7 +10,7 @@ import { MediaViewer } from "./work-flow/media-viewer";
|
||||
import { ThumbnailGrid } from "./work-flow/thumbnail-grid";
|
||||
import { useWorkflowData } from "./work-flow/use-workflow-data";
|
||||
import { usePlaybackControls } from "./work-flow/use-playback-controls";
|
||||
import { AlertCircle, RefreshCw, Pause, Play } from "lucide-react";
|
||||
import { AlertCircle, RefreshCw, Pause, Play, ChevronLast } from "lucide-react";
|
||||
import { motion } from "framer-motion";
|
||||
import { GlassIconButton } from '@/components/ui/glass-icon-button';
|
||||
|
||||
@ -42,6 +42,7 @@ export default function WorkFlow() {
|
||||
setCurrentSketchIndex,
|
||||
retryLoadData,
|
||||
isPauseWorkFlow,
|
||||
mode,
|
||||
setIsPauseWorkFlow,
|
||||
} = useWorkflowData();
|
||||
|
||||
@ -214,14 +215,26 @@ export default function WorkFlow() {
|
||||
</div>
|
||||
|
||||
{/* 暂停/播放按钮 */}
|
||||
<div className="absolute right-12 bottom-12 z-[9999]">
|
||||
<GlassIconButton
|
||||
icon={isPauseWorkFlow ? Play : Pause}
|
||||
size='lg'
|
||||
tooltip={isPauseWorkFlow ? "Play" : "Pause"}
|
||||
onClick={() => setIsPauseWorkFlow(!isPauseWorkFlow)}
|
||||
/>
|
||||
</div>
|
||||
{
|
||||
currentStep !== '6' && (
|
||||
<div className="absolute right-12 bottom-16 z-[9999] flex gap-4">
|
||||
<GlassIconButton
|
||||
icon={isPauseWorkFlow ? Play : Pause}
|
||||
size='lg'
|
||||
tooltip={isPauseWorkFlow ? "Play" : "Pause"}
|
||||
onClick={() => setIsPauseWorkFlow(!isPauseWorkFlow)}
|
||||
/>
|
||||
{ mode !== 'auto' && (
|
||||
<GlassIconButton
|
||||
icon={ChevronLast}
|
||||
size='lg'
|
||||
tooltip="Next"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
{/* AI 建议栏 */}
|
||||
<ErrorBoundary>
|
||||
|
||||
@ -75,6 +75,7 @@ export function useWorkflowData() {
|
||||
const [dataLoadError, setDataLoadError] = useState<string | null>(null);
|
||||
const [needStreamData, setNeedStreamData] = useState(false);
|
||||
const [isPauseWorkFlow, setIsPauseWorkFlow] = useState(false);
|
||||
const [mode, setMode] = useState<'auto' | 'manual'>('manual');
|
||||
|
||||
const dispatch = useAppDispatch();
|
||||
const { sketchCount, videoCount } = useAppSelector((state) => state.workflow);
|
||||
@ -576,6 +577,7 @@ export function useWorkflowData() {
|
||||
retryLoadData,
|
||||
handleManualPlay,
|
||||
isPauseWorkFlow,
|
||||
mode,
|
||||
setIsPauseWorkFlow,
|
||||
};
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user