"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.Changelog = Changelog;

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

var _bs = require("react-icons/bs");

var _ai = require("react-icons/ai");

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; }

/* This example requires Tailwind CSS v2.0+ */
function Avatar(_ref) {
  var person = _ref.person;
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
    src: person.imageUrl,
    alt: person.name,
    className: "rounded-full"
  });
}

var people = [{
  name: "Lindsay Walton",
  imageUrl: "https://images.unsplash.com/photo-1517841905240-472988babdf9?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=3&w=256&h=256&q=80"
}, {
  name: "Eduardo Benz",
  imageUrl: "https://images.unsplash.com/photo-1520785643438-5bf77931f493?ixlib=rb-=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=8&w=256&h=256&q=80"
}];
var timeline = [{
  id: 1,
  content: "Scaled backend app to 3 pods",
  // target: 'Front End Developer',
  href: "#",
  date: "30m ago",
  datetime: "2020-09-20",
  icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_bs.BsArrowUpRight, {
    className: "h-5 w-5 text-white"
  }),
  iconBackground: "bg-gray-400"
}, {
  id: 2,
  content: "Changed db.pool.size from 100 -> 125",
  href: "#",
  date: "45m ago",
  datetime: "2020-09-22",
  icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_bs.BsFillGearFill, {
    className: "h-5 w-5 text-white"
  }),
  iconBackground: "bg-gray-400"
}, {
  id: 3,
  content: "us-east-1 canary failed for 25m",
  date: "2h",
  datetime: "2020-09-28",
  icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ai.AiFillAlert, {
    className: "h-5 w-5 text-white"
  }),
  iconBackground: "bg-gray-500"
}, {
  id: 5,
  content: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
    children: [people[0].name, " assigned as commander"]
  }),
  date: "1h ago",
  datetime: "2020-09-30",
  icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(Avatar, {
    person: people[0]
  }),
  iconBackground: "bg-blue-500 "
}, {
  id: 5,
  content: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
    children: [people[1].name, " assigned as communicator"]
  }),
  date: "1h ago",
  datetime: "2020-09-30",
  icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(Avatar, {
    person: people[1]
  }),
  iconBackground: "bg-blue-500 "
}, {
  id: 4,
  content: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
    className: "text-red-700",
    children: "us-east-1 canary failing for 2h"
  }),
  date: "2h ago",
  datetime: "2020-09-28",
  icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ai.AiFillAlert, {
    className: "h-5 w-5 text-white"
  }),
  iconBackground: "bg-red-500"
}];

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 Changelog() {
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
    className: "flow-root",
    children: /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
      className: "-mb-4",
      children: timeline.map(function (event, eventIdx) {
        return (
          /*#__PURE__*/
          // eslint-disable-next-line react/no-array-index-key
          (0, _jsxRuntime.jsx)("li", {
            children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
              className: "relative pb-4",
              children: [eventIdx !== timeline.length - 1 ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
                className: "absolute top-4 left-4 -ml-px h-full w-0.5 bg-gray-200",
                "aria-hidden": "true"
              }) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
                className: "relative flex space-x-3",
                children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
                  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
                    className: classNames(event.iconBackground, "h-8 w-8 rounded-full flex items-center justify-center ring-8 ring-white"),
                    children: event.icon
                  })
                }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
                  className: "min-w-0 flex-1 pt-1.5 flex justify-between space-x-4",
                  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
                    children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
                      className: "text-sm text-gray-500",
                      children: [event.content, " ", /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
                        href: event.href,
                        className: "font-medium text-gray-900",
                        children: event.target
                      })]
                    })
                  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
                    className: "text-right text-sm whitespace-nowrap text-gray-500",
                    children: /*#__PURE__*/(0, _jsxRuntime.jsx)("time", {
                      dateTime: event.datetime,
                      children: event.date
                    })
                  })]
                })]
              })]
            })
          }, eventIdx)
        );
      })
    })
  });
}