Add delete button to table
This commit is contained in:
parent
fb214b8f7b
commit
83cdb9201e
@ -184,6 +184,23 @@ export default function Table(props) {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
<Button
|
||||||
|
icon={<IconDeleteStroked />}
|
||||||
|
type="danger"
|
||||||
|
block
|
||||||
|
style={{ marginTop: "8px" }}
|
||||||
|
onClick={() => {
|
||||||
|
Toast.success(`Table deleted!`);
|
||||||
|
setTables((prev) =>
|
||||||
|
prev
|
||||||
|
.filter((e) => e.id !== props.tableData.id)
|
||||||
|
.map((e, idx) => ({ ...e, id: idx }))
|
||||||
|
);
|
||||||
|
props.setSelectedTable("");
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Delete table
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
position="rightTop"
|
position="rightTop"
|
||||||
|
Loading…
Reference in New Issue
Block a user