add popconfirm to delete

This commit is contained in:
1ilit 2023-09-19 15:47:33 +03:00
parent 5ce1073bc0
commit b0a5098926

View File

@ -15,6 +15,8 @@ import {
Col, Col,
Popover, Popover,
Tag, Tag,
Popconfirm,
Toast,
} from "@douyinfe/semi-ui"; } from "@douyinfe/semi-ui";
const Rect = (props) => { const Rect = (props) => {
@ -136,12 +138,21 @@ const Rect = (props) => {
> >
<IconPlus /> <IconPlus />
</button> </button>
<button <Popconfirm
className="btn bg-red-800 text-white text-xs py-1 px-2 opacity-80" title="Are you sure you want to delete this table?"
onClick={(e) => props.onDelete(props.id)} content="This modification will be irreversible."
cancelText="Cancel"
okText="Delete"
onConfirm={() => {
Toast.success(`Table deleted!`);
props.onDelete(props.id);
}}
onCancel={() => {}}
> >
<IconDelete /> <button className="btn bg-red-800 text-white text-xs py-1 px-2 opacity-80">
</button> <IconDelete />
</button>
</Popconfirm>
</div> </div>
)} )}
</div> </div>