@qn-pandora/pandora-visualization
Version:
Pandora 通用可视化库
41 lines (40 loc) • 1.95 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
import * as React from 'react';
import { DeleteOutlined } from '@ant-design/icons';
import { Tooltip } from 'antd';
import errorBoundary from '../../../../hocs/errorBoundary';
import { DashboardLocale } from '../../../../constants/language/dashboard/type';
import { formatString } from '../../../../services/language';
import { EActionDisplayMode } from '../../../constants';
var DeleteChart = /** @class */ (function (_super) {
__extends(DeleteChart, _super);
function DeleteChart() {
return _super !== null && _super.apply(this, arguments) || this;
}
DeleteChart.prototype.render = function () {
var _a = this.props, className = _a.className, onClick = _a.onClick, displayMode = _a.displayMode;
if (displayMode === EActionDisplayMode.Icon) {
return (React.createElement(Tooltip, { title: formatString(DashboardLocale.edit.chart.delete) },
React.createElement(DeleteOutlined, { className: className, onClick: onClick })));
}
return (React.createElement("div", { className: className, onClick: onClick }, formatString(DashboardLocale.edit.chart.delete)));
};
DeleteChart.defaultProps = {
displayMode: EActionDisplayMode.Icon
};
return DeleteChart;
}(React.Component));
export { DeleteChart };
export default errorBoundary(DeleteChart);