import classnames from 'classnames';
import { isEmpty } from 'lodash';
import { VmEmpty } from "../../../_components";
import useSettings from "../../../_hooks/useSettings";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
var Rules = function Rules(_ref) {
  var rules = _ref.rules,
    workTypeColorMap = _ref.workTypeColorMap;
  var _useSettings = useSettings(),
    isDark = _useSettings.isDark;
  return /*#__PURE__*/_jsx("div", {
    className: classnames('vtx-road-rule-wrap', {
      'vtx-road-rule-wrap-dark': isDark
    }),
    children: Array.isArray(rules) && !isEmpty(rules) ? rules.filter(function (item) {
      return item.beenLaunch;
    }).map(function (item, index) {
      return /*#__PURE__*/_jsxs("div", {
        className: "vtx-road-rule-wrap-item-wrap",
        children: [/*#__PURE__*/_jsx("div", {
          className: classnames('vtx-road-rule-wrap-work', workTypeColorMap[item.workTypeName]),
          children: item.workTypeName || '--'
        }), /*#__PURE__*/_jsxs("div", {
          children: [/*#__PURE__*/_jsx("span", {
            className: classnames('vtx-road-rule-wrap-number', workTypeColorMap[item.workTypeName], {
              dark: isDark
            }),
            children: item.workCount || '--'
          }), /*#__PURE__*/_jsx("span", {
            className: classnames('vtx-road-rule-wrap-unit', workTypeColorMap[item.workTypeName], {
              dark: isDark
            }),
            children: "\u8D9F"
          })]
        }), /*#__PURE__*/_jsx("div", {
          className: 'vtx-road-rule-wrap-time',
          children: "".concat(item.workStartTime, "-").concat(item.workEndTime)
        })]
      }, index);
    }) : /*#__PURE__*/_jsx(VmEmpty, {
      imgStyle: {
        marginLeft: 0,
        transform: 'translateX(0%)'
      }
    })
  });
};
export default Rules;