import { Collapse, Row, Col, Button } from "@douyinfe/semi-ui";
import { IconPlus } from "@douyinfe/semi-icons";
import { useSelect, useTables } from "../../../hooks";
import { ObjectType } from "../../../data/constants";
import SearchBar from "./SearchBar";
import Empty from "../Empty";
import TableInfo from "./TableInfo";
import { useTranslation } from "react-i18next";
export default function TablesTab() {
const { tables, addTable } = useTables();
const { selectedElement, setSelectedElement } = useSelect();
const { t } = useTranslation();
return (
<>
} block onClick={() => addTable()}>
{t("add_table")}
{tables.length === 0 ? (
) : (
setSelectedElement((prev) => ({
...prev,
open: true,
id: parseInt(k),
element: ObjectType.TABLE,
}))
}
accordion
>
{tables.map((t) => (
{t.name}
}
itemKey={`${t.id}`}
>
))}
)}
>
);
}