| 123456789101112 |
- import { __awaiter } from "tslib";
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
- import { Button, Popconfirm } from 'antd';
- export const DageTableActions = ({ renderBefore, showDelete = true, showEdit = true, size = 'small', onDelete, onEdit, }) => {
- const handleEdit = () => {
- onEdit === null || onEdit === void 0 ? void 0 : onEdit();
- };
- const handleDelete = () => __awaiter(void 0, void 0, void 0, function* () {
- yield (onDelete === null || onDelete === void 0 ? void 0 : onDelete());
- });
- return (_jsxs(_Fragment, { children: [renderBefore, showEdit && (_jsx(Button, { className: "dage-table-action__edit", size: size, type: "link", onClick: handleEdit, children: "\u7F16\u8F91" })), showDelete && (_jsx(Popconfirm, { title: "\u5220\u9664\u540E\u65E0\u6CD5\u6062\u590D\uFF0C\u662F\u5426\u5220\u9664?", okText: "\u5220\u9664", cancelText: "\u53D6\u6D88", onConfirm: handleDelete, children: _jsx(Button, { className: "dage-table-action_del", size: size, type: "link", danger: true, children: "\u5220\u9664" }) }))] }));
- };
|