diff --git a/components/pages/work-flow.tsx b/components/pages/work-flow.tsx index ca04305..1f58411 100644 --- a/components/pages/work-flow.tsx +++ b/components/pages/work-flow.tsx @@ -16,6 +16,7 @@ import { SaveEditUseCase } from "@/app/service/usecase/SaveEditUseCase"; import { useSearchParams } from "next/navigation"; import SmartChatBox from "@/components/SmartChatBox/SmartChatBox"; import { Drawer } from 'antd'; +import { AIEditingIconButton } from './work-flow/ai-editing-button'; const WorkFlow = React.memo(function WorkFlow() { useEffect(() => { @@ -29,6 +30,7 @@ const WorkFlow = React.memo(function WorkFlow() { const [previewVideoUrl, setPreviewVideoUrl] = React.useState(null); const [previewVideoId, setPreviewVideoId] = React.useState(null); const [isFocusChatInput, setIsFocusChatInput] = React.useState(false); + const [aiEditingInProgress, setAiEditingInProgress] = React.useState(false); const searchParams = useSearchParams(); const episodeId = searchParams.get('episodeId') || ''; @@ -78,6 +80,28 @@ const WorkFlow = React.memo(function WorkFlow() { setIsEditModalOpen(true); }, []); + // AI剪辑回调函数 + const handleAIEditingComplete = useCallback((finalVideoUrl: string) => { + console.log('🎉 AI剪辑完成,最终视频URL:', finalVideoUrl); + + // 更新任务对象的最终视频状态 + setAnyAttribute('final', { + url: finalVideoUrl, + note: 'ai_edited' + }); + + // 切换到最终视频阶段 + setAnyAttribute('currentStage', 'final_video'); + + setAiEditingInProgress(false); + }, [setAnyAttribute]); + + const handleAIEditingError = useCallback((error: string) => { + console.error('❌ AI剪辑失败:', error); + // 这里可以显示错误提示 + setAiEditingInProgress(false); + }, []); + return (
@@ -194,6 +218,22 @@ const WorkFlow = React.memo(function WorkFlow() { ) } + {/* AI剪辑按钮 - 当有视频片段时显示 */} + { + (taskObject.currentStage === 'video' && taskObject.videos.data.length > 0) && ( +
+ +
+ ) + } + {/* 智能对话按钮 */}