"use client"; import { useState } from "react"; import { useRouter } from "next/navigation"; import DataFlowList from "@/components/dataflow/DataFlowList"; import { FlowEditor } from "@/components/dataflow/node-editor/FlowEditor"; import { useAuth } from "@/hooks/useAuth"; import { toast } from "sonner"; import { Button } from "@/components/ui/button"; import { ScrollToTop } from "@/components/common/ScrollToTop"; import { ArrowLeft } from "lucide-react"; type Step = "list" | "editor"; export default function DataFlowPage() { const { user } = useAuth(); const router = useRouter(); const [currentStep, setCurrentStep] = useState("list"); const [loadingFlowId, setLoadingFlowId] = useState(null); // 플로우 불러오기 핸들러 const handleLoadFlow = async (flowId: number | null) => { if (flowId === null) { // 새 플로우 생성 setLoadingFlowId(null); setCurrentStep("editor"); return; } try { // 기존 플로우 불러오기 setLoadingFlowId(flowId); setCurrentStep("editor"); toast.success("플로우를 불러왔습니다."); } catch (error: any) { console.error("❌ 플로우 불러오기 실패:", error); toast.error(error.message || "플로우를 불러오는데 실패했습니다."); } }; // 목록으로 돌아가기 const handleBackToList = () => { setCurrentStep("list"); setLoadingFlowId(null); }; // 에디터 모드일 때는 전체 화면 사용 const isEditorMode = currentStep === "editor"; // 에디터 모드일 때는 레이아웃 없이 전체 화면 사용 if (isEditorMode) { return (
{/* 에디터 헤더 */}

노드 플로우 에디터

드래그 앤 드롭으로 데이터 제어 플로우를 시각적으로 설계합니다

{/* 플로우 에디터 */}
); } return (
{/* 페이지 헤더 */}

제어 관리

노드 기반 데이터 플로우를 시각적으로 설계하고 관리합니다

{/* 플로우 목록 */}
{/* Scroll to Top 버튼 */}
); }