"use client"; import React, { useState } from "react"; import { ConnectionTypeSelector } from "./LeftPanel/ConnectionTypeSelector"; import { MappingInfoPanel } from "./LeftPanel/MappingInfoPanel"; import { StepProgress } from "./RightPanel/StepProgress"; import { ConnectionStep } from "./RightPanel/ConnectionStep"; import { TableStep } from "./RightPanel/TableStep"; import { FieldMappingStep } from "./RightPanel/FieldMappingStep"; import { DataConnectionState } from "./types/redesigned"; import { ResponsiveContainer, ResponsiveGrid } from "@/components/layout/ResponsiveContainer"; import { useResponsive } from "@/lib/hooks/useResponsive"; const initialState: DataConnectionState = { connectionType: "data_save", currentStep: 1, fieldMappings: [], mappingStats: { totalMappings: 0, validMappings: 0, invalidMappings: 0, missingRequiredFields: 0, estimatedRows: 0, actionType: "INSERT", }, isLoading: false, validationErrors: [], }; export const DataConnectionDesigner: React.FC = () => { const [state, setState] = useState(initialState); const { isMobile, isTablet } = useResponsive(); return (

제어관리 - 데이터 연결 설정

시각적 필드 매핑으로 데이터 연결을 쉽게 설정하세요

setState(prev => ({ ...prev, connectionType: type }))} />
setState(prev => ({ ...prev, selectedMapping: mappingId }))} />
setState(prev => ({ ...prev, currentStep: step }))} />
{state.currentStep === 1 && ( setState(prev => ({ ...prev, fromConnection: conn }))} onToConnectionChange={(conn) => setState(prev => ({ ...prev, toConnection: conn }))} onNext={() => setState(prev => ({ ...prev, currentStep: 2 }))} /> )} {state.currentStep === 2 && ( setState(prev => ({ ...prev, fromTable: table }))} onToTableChange={(table) => setState(prev => ({ ...prev, toTable: table }))} onNext={() => setState(prev => ({ ...prev, currentStep: 3 }))} onBack={() => setState(prev => ({ ...prev, currentStep: 1 }))} /> )} {state.currentStep === 3 && ( setState(prev => ({ ...prev, fieldMappings: mappings }))} onBack={() => setState(prev => ({ ...prev, currentStep: 2 }))} onSave={() => { // 저장 로직 console.log("저장:", state); alert("데이터 연결 설정이 저장되었습니다!"); }} /> )}
); }; export default DataConnectionDesigner;