import { React, useState } from "react"; import { defaultTableTheme, sqlDataTypes, tableThemes } from "../data/data"; import { Collapse, Input, Row, Col, Form, Button, Card, Popover, Checkbox, Select, } from "@douyinfe/semi-ui"; import { IconMore, IconKeyStroked, IconColorPalette, IconDeleteStroked, IconCheckboxTick, } from "@douyinfe/semi-icons"; export default function TableOverview(props) { const [indexActiveKey, setIndexActiveKey] = useState(""); const updateColor = (id, c) => { const updatedTables = [...props.tables]; updatedTables[id] = { ...updatedTables[id], color: c }; props.setTables(updatedTables); }; return ( {props.tables.map((t, i) => ( } itemKey={`${i}`} > {t.fields.map((f, j) => (
{ const updatedTables = [...props.tables]; updatedTables[i].fields = updatedTables[i].fields.map( (field, index) => index === j ? { ...field, ...value.values } : field ); props.setTables(updatedTables); }} > { return { label: value, value: value, }; })} filter initValue={f.type} > { const updatedTables = [...props.tables]; updatedTables[i] = { ...updatedTables[i], fields: updatedTables[i].fields.map( (field, index) => index === j ? { ...field, ...value.values } : field ), }; props.setTables(updatedTables); }} >
{ const updatedTables = [...props.tables]; updatedTables[i].fields = updatedTables[ i ].fields.map((field, index) => index === j ? { ...field, [checkedValues.target.value]: checkedValues.target.checked, } : field ); props.setTables(updatedTables); }} >
{ const updatedTables = [...props.tables]; updatedTables[i].fields = updatedTables[ i ].fields.map((field, index) => index === j ? { ...field, [checkedValues.target.value]: checkedValues.target.checked, } : field ); props.setTables(updatedTables); }} >
} trigger="click" position="rightTop" showArrow >
))} {t.indices.length > 0 && ( setIndexActiveKey(itemKey)} > {t.indices.map((idx, k) => (