react-json-schema-editor-antd
Version:
Json Schema Editor
48 lines • 1.47 kB
JavaScript
import { Button, Col, Flex, Popconfirm, Tooltip } from 'antd';
import React, { memo } from 'react';
import { useTranslation } from 'react-i18next';
import IconFont from "../../../../../components/IconFont";
var ControlBtns = function ControlBtns(props) {
var _useTranslation = useTranslation(),
t = _useTranslation.t;
var isHiddenDelete = props.isHiddenDelete,
removeProperty = props.removeProperty,
namePath = props.namePath;
return /*#__PURE__*/React.createElement(Flex, {
className: "schema-btn-controls",
flex: '20px',
align: "center",
style: {
maxWidth: '20px',
marginLeft: 'auto'
}
}, /*#__PURE__*/React.createElement(Col, {
flex: '20px'
}, isHiddenDelete ? /*#__PURE__*/React.createElement("div", {
style: {
width: '20px'
}
}) : /*#__PURE__*/React.createElement(Tooltip, {
title: t('delete_node')
}, /*#__PURE__*/React.createElement(Popconfirm, {
title: t('confirm_delete'),
onConfirm: function onConfirm() {
if (removeProperty) {
removeProperty(namePath);
}
}
}, /*#__PURE__*/React.createElement(Button, {
className: "schema-btn-delete",
type: 'text',
size: 'small',
icon: /*#__PURE__*/React.createElement(IconFont, {
type: "icon-delete"
}),
onClick: function onClick() {
// if (removeProperty) {
// removeProperty(namePath);
// }
}
})))));
};
export default /*#__PURE__*/memo(ControlBtns);