Remove duplicate logic to edit table

This commit is contained in:
1ilit 2024-04-06 09:51:38 +03:00
parent 0ec280b821
commit 234d4fc04b
3 changed files with 266 additions and 1236 deletions

File diff suppressed because it is too large Load Diff

View File

@ -24,15 +24,7 @@ export default function TableInfo({ data }) {
const [editField, setEditField] = useState({});
return (
<div id={`scroll_table_${data.id}`}>
<Collapse.Panel
header={
<div className="overflow-hidden text-ellipsis whitespace-nowrap">
{data.name}
</div>
}
itemKey={`${data.id}`}
>
<div>
<div className="flex items-center mb-2.5">
<div className="text-md font-semibold">Name: </div>
<Input
@ -260,7 +252,6 @@ export default function TableInfo({ data }) {
/>
</Col>
</Row>
</Collapse.Panel>
</div>
);
}

View File

@ -36,7 +36,18 @@ export default function TablesTab() {
accordion
>
{tables.map((t) => (
<TableInfo data={t} key={t.id} />
<div id={`scroll_table_${t.id}`} key={t.id}>
<Collapse.Panel
header={
<div className="overflow-hidden text-ellipsis whitespace-nowrap">
{t.name}
</div>
}
itemKey={`${t.id}`}
>
<TableInfo data={t} />
</Collapse.Panel>
</div>
))}
</Collapse>
)}