"use strict";

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

var _react = require("react");

var _react2 = require("@headlessui/react");

var _outline = require("@heroicons/react/outline");

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

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

function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }

function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }

function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }

function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }

function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }

function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }

function Notification() {
  var _useState = (0, _react.useState)(true),
      _useState2 = _slicedToArray(_useState, 2),
      show = _useState2[0],
      setShow = _useState2[1];

  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
    children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
      "aria-live": "assertive",
      className: "fixed inset-0 flex items-end px-4 py-6 pointer-events-none sm:p-6 sm:items-start",
      children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
        className: "w-full flex flex-col items-center space-y-4 sm:items-end",
        children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.Transition, {
          show: show,
          as: _react.Fragment,
          enter: "transform ease-out duration-300 transition",
          enterFrom: "translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2",
          enterTo: "translate-y-0 opacity-100 sm:translate-x-0",
          leave: "transition ease-in duration-100",
          leaveFrom: "opacity-100",
          leaveTo: "opacity-0",
          children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
            className: "max-w-sm w-full bg-white shadow-lg rounded-lg pointer-events-auto ring-1 ring-black ring-opacity-5 overflow-hidden",
            children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
              className: "p-4",
              children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
                className: "flex items-start",
                children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
                  className: "flex-shrink-0",
                  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_outline.CheckCircleIcon, {
                    className: "h-6 w-6 text-green-400",
                    "aria-hidden": "true"
                  })
                }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
                  className: "ml-3 w-0 flex-1 pt-0.5",
                  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
                    className: "text-sm font-medium text-gray-900",
                    children: "Successfully saved!"
                  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
                    className: "mt-1 text-sm text-gray-500",
                    children: "Anyone with a link can now view this file."
                  })]
                }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
                  className: "ml-4 flex-shrink-0 flex",
                  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
                    type: "button",
                    className: "bg-white rounded-md inline-flex text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",
                    onClick: function onClick() {
                      setShow(false);
                    },
                    children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
                      className: "sr-only",
                      children: "Close"
                    }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_solid.XIcon, {
                      className: "h-5 w-5",
                      "aria-hidden": "true"
                    })]
                  })
                })]
              })
            })
          })
        })
      })
    })
  });
}