UNPKG

@antv/dumi-theme-antv

Version:
39 lines 1.39 kB
import { Link } from 'dumi'; import React from 'react'; import styles from "./Notification.module.less"; var numberImages = ['https://gw.alipayobjects.com/zos/antfincdn/IqREAm36K7/1.png', 'https://gw.alipayobjects.com/zos/antfincdn/3fG1Iqjfnz/2.png']; var Notification = function Notification(_ref) { var _ref$index = _ref.index, index = _ref$index === void 0 ? 0 : _ref$index, type = _ref.type, title = _ref.title, date = _ref.date, _ref$link = _ref.link, link = _ref$link === void 0 ? '' : _ref$link; var children = /*#__PURE__*/React.createElement("div", { className: styles.container }, /*#__PURE__*/React.createElement("img", { className: styles.number, src: numberImages[index], alt: index.toString() }), /*#__PURE__*/React.createElement("div", { className: styles.content }, /*#__PURE__*/React.createElement("p", { className: styles.description }, type, " \u2027 ", title), /*#__PURE__*/React.createElement("p", { className: styles.date }, date))); if (link.startsWith('http')) { return /*#__PURE__*/React.createElement("a", { href: link, target: "_blank", rel: "noopener noreferrer", className: styles.notification }, children); } return /*#__PURE__*/React.createElement(Link, { to: link, className: styles.notification }, children); }; export default Notification;