import React, { useContext, useState } from "react";
import {
AutoComplete,
Collapse,
Empty,
Form,
Row,
Col,
Button,
Checkbox,
Popover,
Table,
} from "@douyinfe/semi-ui";
import {
IconRowsStroked,
IconDeleteStroked,
IconLoopTextStroked,
IconMore,
IconSearch,
} from "@douyinfe/semi-icons";
import {
IllustrationNoContent,
IllustrationNoContentDark,
} from "@douyinfe/semi-illustrations";
import { Cardinality, Constraint } from "../data/data";
import { TableContext } from "../pages/editor";
export default function ReferenceOverview(props) {
const columns = [
{
title: "Primary",
dataIndex: "primary",
},
{
title: "Foreign",
dataIndex: "foreign",
},
];
const { tables, relationships, setRelationships } = useContext(TableContext);
const [refActiveIndex, setRefActiveIndex] = useState("");
const [value, setValue] = useState("");
const [filteredResult, setFilteredResult] = useState(
relationships.map((t) => {
return t.name;
})
);
const handleStringSearch = (value) => {
setFilteredResult(
relationships
.map((t) => {
return t.name;
})
.filter((i) => i.includes(value))
);
};
return (
<>