"use client"; /** * 노드 속성 편집 패널 */ import { X } from "lucide-react"; import { Button } from "@/components/ui/button"; import { useFlowEditorStore } from "@/lib/stores/flowEditorStore"; import { TableSourceProperties } from "./properties/TableSourceProperties"; import { ReferenceLookupProperties } from "./properties/ReferenceLookupProperties"; import { InsertActionProperties } from "./properties/InsertActionProperties"; import { ConditionProperties } from "./properties/ConditionProperties"; import { UpdateActionProperties } from "./properties/UpdateActionProperties"; import { DeleteActionProperties } from "./properties/DeleteActionProperties"; import { ExternalDBSourceProperties } from "./properties/ExternalDBSourceProperties"; import { UpsertActionProperties } from "./properties/UpsertActionProperties"; import { DataTransformProperties } from "./properties/DataTransformProperties"; import { RestAPISourceProperties } from "./properties/RestAPISourceProperties"; import { CommentProperties } from "./properties/CommentProperties"; import { LogProperties } from "./properties/LogProperties"; import type { NodeType } from "@/types/node-editor"; export function PropertiesPanel() { const { nodes, selectedNodes, setShowPropertiesPanel } = useFlowEditorStore(); // 선택된 노드가 하나일 경우 해당 노드 데이터 가져오기 const selectedNode = selectedNodes.length === 1 ? nodes.find((n) => n.id === selectedNodes[0]) : null; return (
{/* 헤더 */}

속성

{selectedNode && (

{getNodeTypeLabel(selectedNode.type as NodeType)}

)}
{/* 내용 */}
{selectedNodes.length === 0 ? (
📝

노드를 선택하여

속성을 편집하세요

) : selectedNodes.length === 1 && selectedNode ? ( ) : (
📋

{selectedNodes.length}개의 노드가

선택되었습니다

한 번에 하나의 노드만 편집할 수 있습니다

)}
); } /** * 노드 타입별 속성 렌더러 */ function NodePropertiesRenderer({ node }: { node: any }) { switch (node.type) { case "tableSource": return ; case "referenceLookup": return ; case "insertAction": return ; case "condition": return ; case "updateAction": return ; case "deleteAction": return ; case "externalDBSource": return ; case "upsertAction": return ; case "dataTransform": return ; case "restAPISource": return ; case "comment": return ; case "log": return ; default: return (

🚧 속성 편집 준비 중

{getNodeTypeLabel(node.type as NodeType)} 노드의 속성 편집 UI는 곧 구현될 예정입니다.

노드 ID:

{node.id}

); } } /** * 노드 타입 라벨 가져오기 */ function getNodeTypeLabel(type: NodeType): string { const labels: Record = { tableSource: "테이블 소스", externalDBSource: "외부 DB 소스", restAPISource: "REST API 소스", condition: "조건 분기", fieldMapping: "필드 매핑", dataTransform: "데이터 변환", insertAction: "INSERT 액션", updateAction: "UPDATE 액션", deleteAction: "DELETE 액션", upsertAction: "UPSERT 액션", comment: "주석", log: "로그", }; return labels[type] || type; }