"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.Metrics = void 0;

var _react = _interopRequireDefault(require("react"));

var _propTypes = _interopRequireDefault(require("prop-types"));

var _clsx = _interopRequireDefault(require("clsx"));

var _property = require("./property");

var _jsxRuntime = require("react/jsx-runtime");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Metrics = function Metrics(_ref) {
  var items = _ref.items,
      row = _ref.row;
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
    className: "flex rounded-b-8px divide-x flex-1 justify-between items-center",
    children: items.map(function (item) {
      return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
        className: (0, _clsx.default)("text-gray-800 px-2 align-middle text-center flex flex-1", {
          "flex-col": !row,
          "flex-row items-center justify-center": row
        }),
        children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("h6", {
          className: "text-gray-color text-xs mb-0.5",
          children: [item.name, row && ":"]
        }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
          className: (0, _clsx.default)("font-bold text-xs leading-1.21rel", "text-".concat(item.color, "-500"), {
            "pl-1": row
          }),
          children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_property.FormatProperty, {
            property: item,
            short: true
          })
        })]
      }, item.name);
    })
  });
};

exports.Metrics = Metrics;
Metrics.propTypes = {
  items: _propTypes.default.arrayOf(_propTypes.default.shape({
    name: _propTypes.default.string.isRequired,
    color: _propTypes.default.string
  })).isRequired,
  row: _propTypes.default.bool
};
Metrics.defaultProps = {
  row: false
};