import React, { useState } from 'react'; import { FaTimes, FaColumns, FaKey } from 'react-icons/fa'; const ColumnCreationPopup = ({ onClose, onCreateColumn, tableInfo }) => { const [columnName, setColumnName] = useState(''); const [dataType, setDataType] = useState('TEXT'); const [description, setDescription] = useState(''); const [alias, setAlias] = useState(''); const [isKey, setIsKey] = useState(false); const handleSubmit = (e) => { e.preventDefault(); if (columnName.trim() === '') return; onCreateColumn({ name: columnName, data_type: dataType, description: description, alias: alias, is_key: isKey ? 1 : 0, tbl: tableInfo.tbl, sch: tableInfo.sch, con: tableInfo.con }); onClose(); }; return (
Table: {tableInfo.tbl}
Schema: {tableInfo.sch}
Database: {tableInfo.con}