"use strict";

function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

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

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

var _solid = require("@heroicons/react/solid");

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

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

function classNames() {
  for (var _len = arguments.length, classes = new Array(_len), _key = 0; _key < _len; _key++) {
    classes[_key] = arguments[_key];
  }

  return classes.filter(Boolean).join(" ");
}

function Feed(_ref) {
  var items = _ref.items;
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
    className: "container mx-auto",
    children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
      className: "flow-root",
      children: /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
        className: "-mb-4",
        children: items.map(function (item, idx) {
          return /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
            children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
              className: "relative pb-4",
              children: [idx !== items.length - 1 ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
                className: "absolute top-5 left-5 -ml-px h-full w-0.5 bg-gray-200",
                "aria-hidden": "true"
              }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
                className: "relative flex items-start space-x-3",
                children: item.type === "comment" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
                  children: [item.icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
                    className: "relative ",
                    children: item.icon
                  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
                    className: "relative px-1",
                    children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
                      className: "h-8 w-8 px-1 bg-gray-100 rounded-full ring-8 ring-white flex items-center justify-center",
                      children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_solid.UserCircleIcon, {
                        className: "h-5 w-5 text-gray-500",
                        "aria-hidden": "true"
                      })
                    })
                  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
                    className: "min-w-0 flex-1",
                    children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
                      children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
                        className: "text-sm",
                        children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
                          href: item.person.href,
                          className: "font-medium text-gray-900",
                          children: item.person.name
                        }), " ", "added tags", " "]
                      })
                    }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
                      className: "mt-2 text-sm text-gray-700",
                      children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
                        children: item.comment
                      })
                    })]
                  }), item.tags != null && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
                    className: "mr-0.5",
                    children: item.tags.map(function (tag) {
                      return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
                        children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("a", {
                          href: tag.href,
                          className: "relative inline-flex items-center rounded-full border border-gray-300 px-3 py-0.5 text-sm",
                          children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
                            className: "absolute flex-shrink-0 flex items-center justify-center",
                            children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
                              className: classNames(tag.color, "h-1.5 w-1.5 rounded-full"),
                              "aria-hidden": "true"
                            })
                          }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
                            className: "ml-3.5 font-medium text-gray-900",
                            children: tag.name
                          })]
                        }), " "]
                      }, tag.name);
                    })
                  })]
                }) : item.type === "assignment" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
                  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
                    children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
                      className: "relative px-1",
                      children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
                        className: "h-8 w-8 bg-gray-100 rounded-full ring-8 ring-white flex items-center justify-center",
                        children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_solid.UserCircleIcon, {
                          className: "h-5 w-5 text-gray-500",
                          "aria-hidden": "true"
                        })
                      })
                    })
                  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
                    className: "min-w-0 flex-1 py-1.5",
                    children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
                      className: "text-sm text-gray-500",
                      children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
                        href: item.person.href,
                        className: "font-medium text-gray-900",
                        children: item.person.name
                      }), " ", "assigned", " ", /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
                        href: item.assigned.href,
                        className: "font-medium text-gray-900",
                        children: item.assigned.name
                      }), " ", /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
                        className: "whitespace-nowrap",
                        children: item.date
                      })]
                    })
                  })]
                }) : item.type === "tags" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
                  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
                    children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
                      className: "relative px-1",
                      children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
                        className: "h-8 w-8 bg-gray-100 rounded-full ring-8 ring-white flex items-center justify-center",
                        children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_solid.TagIcon, {
                          className: "h-5 w-5 text-gray-500",
                          "aria-hidden": "true"
                        })
                      })
                    })
                  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
                    className: "min-w-0 flex-1 py-0",
                    children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
                      className: "text-sm leading-8 text-gray-500",
                      children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
                        className: "mr-0.5",
                        children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
                          href: item.person.href,
                          className: "font-medium text-gray-900",
                          children: item.person.name
                        }), " ", "added tags"]
                      }), " ", /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
                        className: "mr-0.5",
                        children: item.tags.map(function (tag) {
                          return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
                            children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("a", {
                              href: tag.href,
                              className: "relative inline-flex items-center rounded-full border border-gray-300 px-3 py-0.5 text-sm",
                              children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
                                className: "absolute flex-shrink-0 flex items-center justify-center",
                                children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
                                  className: classNames(tag.color, "h-1.5 w-1.5 rounded-full"),
                                  "aria-hidden": "true"
                                })
                              }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
                                className: "ml-3.5 font-medium text-gray-900",
                                children: tag.name
                              })]
                            }), " "]
                          }, tag.name);
                        })
                      }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
                        className: "whitespace-nowrap",
                        children: item.date
                      })]
                    })
                  })]
                }) : null
              })]
            })
          }, item.id);
        })
      })
    })
  });
}