import { default as classnames, default as classNames } from 'classnames';
import { isEmpty } from 'lodash';
import { VmEmpty, VmTag } 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-lane-rule-wrap', {
      'vtx-road-lane-rule-wrap-dark': isDark
    }),
    children: Array.isArray(rules) && !isEmpty(rules) ? rules.map(function (item, index) {
      return /*#__PURE__*/_jsxs("div", {
        className: "vtx-road-lane-rule-item",
        children: [/*#__PURE__*/_jsx("div", {
          className: classNames('vtx-road-lane-rule-item-left', workTypeColorMap[item.workTypeName])
        }), /*#__PURE__*/_jsxs("div", {
          className: "vtx-road-lane-rule-item-right",
          children: [/*#__PURE__*/_jsxs("div", {
            className: "vtx-road-lane-rule-item-top",
            children: [/*#__PURE__*/_jsx("div", {
              style: {
                fontWeight: 600
              },
              children: item.facilityTypeName
            }), /*#__PURE__*/_jsx(VmTag, {
              color: workTypeColorMap[item.workTypeName],
              title: item.workTypeName
            })]
          }), /*#__PURE__*/_jsxs("div", {
            className: "vtx-road-lane-rule-item-bottom",
            children: [/*#__PURE__*/_jsx("img", {
              src: isDark ? require("../../imgs/dark_car.png") : require("../../imgs/car.png"),
              alt: "",
              width: 16,
              height: 16
            }), /*#__PURE__*/_jsx("div", {
              children: item.workCarCode
            }), /*#__PURE__*/_jsx("div", {
              className: "vtx-road-lane-rule-item-bottom-line"
            }), /*#__PURE__*/_jsx("img", {
              src: isDark ? require("../../imgs/dark_person.png") : require("../../imgs/person.png"),
              alt: "",
              width: 16,
              height: 16
            }), /*#__PURE__*/_jsx("div", {
              children: item.driverName
            })]
          })]
        })]
      }, index);
    }) : /*#__PURE__*/_jsx(VmEmpty, {
      imgStyle: {
        marginLeft: 0,
        transform: 'translateX(0%)'
      }
    })
  });
};
export default Rules;