"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;