"use client"; import React from "react"; import { TableNodeData } from "@/types/dataflowTypes"; interface SelectedTablesPanelProps { selectedNodes: string[]; nodes: Array<{ id: string; data: TableNodeData; }>; onClose: () => void; onOpenConnectionModal: () => void; onClear: () => void; canCreateConnection: boolean; } export const SelectedTablesPanel: React.FC = ({ selectedNodes, nodes, onClose, onOpenConnectionModal, onClear, canCreateConnection, }) => { return (
{/* 헀더 */}
πŸ“‹
μ„ νƒλœ ν…Œμ΄λΈ”
{selectedNodes.length === 1 ? "FROM ν…Œμ΄λΈ” 선택됨" : selectedNodes.length === 2 ? "FROM β†’ TO μ—°κ²° μ€€λΉ„" : `${selectedNodes.length}개 ν…Œμ΄λΈ”`}
{/* 컨텐츠 */}
{selectedNodes.map((nodeId, index) => { const node = nodes.find((n) => n.id === nodeId); if (!node) return null; const { tableName, displayName } = node.data.table; return (
{/* ν…Œμ΄λΈ” 정보 */}
{displayName}
{selectedNodes.length === 2 && (
{index === 0 ? "FROM" : "TO"}
)}
{tableName}
{/* μ—°κ²° ν™”μ‚΄ν‘œ (λ§ˆμ§€λ§‰μ΄ μ•„λ‹Œ 경우) */} {index < selectedNodes.length - 1 && (
β†’
)}
); })}
{/* μ•‘μ…˜ λ²„νŠΌ */}
); };