"use client";

import React from "react";
import { TableInfo, ColumnInfo } from "@/lib/api/dataflow";
import { DataSaveSettings as DataSaveSettingsType } from "@/types/connectionTypes";

// 🎨 새로운 UI 컴포넌트 import
import DataConnectionDesigner from "./redesigned/DataConnectionDesigner";

interface DataSaveSettingsProps {
  settings: DataSaveSettingsType;
  onSettingsChange: (settings: DataSaveSettingsType) => void;
  availableTables: TableInfo[];
  fromTableColumns: ColumnInfo[];
  toTableColumns: ColumnInfo[];
  fromTableName?: string;
  toTableName?: string;
  tableColumnsCache: { [tableName: string]: ColumnInfo[] };
}

/**
 * 🎨 데이터 저장 설정 컴포넌트
 * - 항상 새로운 UI (DataConnectionDesigner) 사용
 * - 기존 UI는 더 이상 사용하지 않음
 */
export const DataSaveSettings: React.FC<DataSaveSettingsProps> = ({
  settings,
  onSettingsChange,
  availableTables,
  fromTableColumns,
  toTableColumns,
  fromTableName,
  toTableName,
  tableColumnsCache,
}) => {
  // 🎨 항상 새로운 UI 사용
  return (
    <DataConnectionDesigner
      onClose={undefined} // 닫기 버튼 제거 (항상 새 UI 사용)
      initialData={{
        connectionType: "data_save",
      }}
    />
  );
};
