index.js 716 B

12345678910111213141516171819202122232425262728
  1. import * as React from 'react';
  2. import Mark from "./Mark";
  3. var Marks = function Marks(props) {
  4. var prefixCls = props.prefixCls,
  5. marks = props.marks,
  6. onClick = props.onClick;
  7. var markPrefixCls = "".concat(prefixCls, "-mark");
  8. // Not render mark if empty
  9. if (!marks.length) {
  10. return null;
  11. }
  12. return /*#__PURE__*/React.createElement("div", {
  13. className: markPrefixCls
  14. }, marks.map(function (_ref) {
  15. var value = _ref.value,
  16. style = _ref.style,
  17. label = _ref.label;
  18. return /*#__PURE__*/React.createElement(Mark, {
  19. key: value,
  20. prefixCls: markPrefixCls,
  21. style: style,
  22. value: value,
  23. onClick: onClick
  24. }, label);
  25. }));
  26. };
  27. export default Marks;