"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

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

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));

var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));

var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));

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

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

var _LinkSet = _interopRequireDefault(require("./LinkSet"));

var _formatMessage = _interopRequireDefault(require("../../format-message"));

/*
 * Copyright (C) 2018 - present Instructure, Inc.
 *
 * This file is part of Canvas.
 *
 * Canvas is free software: you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License as published by the Free
 * Software Foundation, version 3 of the License.
 *
 * Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Affero General Public License along
 * with this program. If not, see <http://www.gnu.org/licenses/>.
 */
var NavigationPanel =
/*#__PURE__*/
function (_Component) {
  (0, _inherits2.default)(NavigationPanel, _Component);

  function NavigationPanel() {
    (0, _classCallCheck2.default)(this, NavigationPanel);
    return (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(NavigationPanel).apply(this, arguments));
  }

  (0, _createClass2.default)(NavigationPanel, [{
    key: "collection",
    value: function collection() {
      var contextId = this.props.contextId;

      switch (this.props.contextType) {
        case "course":
          return {
            links: [{
              href: "/courses/".concat(contextId, "/assignments"),
              title: "\u0395\u03C1\u03B3\u03B1\u03C3\u03AF\u03B5\u03C2"
            }, {
              href: "/courses/".concat(contextId, "/pages"),
              title: "\u03A3\u03B5\u03BB\u03AF\u03B4\u03B5\u03C2"
            }, {
              href: "/courses/".concat(contextId, "/discussion_topics"),
              title: "\u03A3\u03C5\u03B6\u03B7\u03C4\u03AE\u03C3\u03B5\u03B9\u03C2"
            }, {
              href: "/courses/".concat(contextId, "/assignments/syllabus"),
              title: "\u0391\u03BD\u03B1\u03BB\u03C5\u03C4\u03B9\u03BA\u03CC \u03A0\u03C1\u03CC\u03B3\u03C1\u03B1\u03BC\u03BC\u03B1"
            }, {
              href: "/courses/".concat(contextId, "/announcements"),
              title: "\u0391\u03BD\u03B1\u03BA\u03BF\u03B9\u03BD\u03CE\u03C3\u03B5\u03B9\u03C2"
            }, {
              href: "/courses/".concat(contextId, "/quizzes"),
              title: "\u039A\u03BF\u03C5\u03AF\u03B6"
            }, {
              href: "/courses/".concat(contextId, "/files"),
              title: "\u0391\u03C1\u03C7\u03B5\u03AF\u03B1"
            }, {
              href: "/courses/".concat(contextId, "/collaborations"),
              title: "\u03A3\u03C5\u03BD\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B5\u03C2"
            }, {
              href: "/courses/".concat(contextId, "/grades"),
              title: "\u0392\u03B1\u03B8\u03BC\u03BF\u03AF"
            }, {
              href: "/courses/".concat(contextId, "/users"),
              title: "\u039A\u03BF\u03B9\u03BD\u03CC"
            }, {
              href: "/courses/".concat(contextId, "/modules"),
              title: "\u0395\u03BD\u03CC\u03C4\u03B7\u03C4\u03B5\u03C2"
            }]
          };

        case "group":
          return {
            links: [{
              href: "/groups/".concat(contextId, "/pages"),
              title: "\u0391\u03C1\u03C7\u03B9\u03BA\u03AE \u03A3\u03B5\u03BB\u03AF\u03B4\u03B1 Wiki"
            }, {
              href: "/groups/".concat(contextId, "/discussion_topics"),
              title: "\u0395\u03C5\u03C1\u03B5\u03C4\u03AE\u03C1\u03B9\u03BF \u03A3\u03C5\u03B6\u03B7\u03C4\u03AE\u03C3\u03B5\u03C9\u03BD"
            }, {
              href: "/groups/".concat(contextId, "/announcements"),
              title: "\u039B\u03AF\u03C3\u03C4\u03B1 \u0391\u03BD\u03B1\u03BA\u03BF\u03B9\u03BD\u03CE\u03C3\u03B5\u03C9\u03BD"
            }, {
              href: "/groups/".concat(contextId, "/files"),
              title: "\u0395\u03C5\u03C1\u03B5\u03C4\u03AE\u03C1\u03B9\u03BF \u0391\u03C1\u03C7\u03B5\u03AF\u03C9\u03BD"
            }, {
              href: "/groups/".concat(contextId, "/collaborations"),
              title: "\u03A3\u03C5\u03BD\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B5\u03C2"
            }, {
              href: "/groups/".concat(contextId, "/users"),
              title: "\u039A\u03BF\u03B9\u03BD\u03CC"
            }]
          };

        default:
          // user, TODO
          return {
            links: [{
              href: "/users/".concat(contextId, "/files"),
              title: "\u0395\u03C5\u03C1\u03B5\u03C4\u03AE\u03C1\u03B9\u03BF \u0391\u03C1\u03C7\u03B5\u03AF\u03C9\u03BD"
            }]
          };
      }
    }
  }, {
    key: "render",
    value: function render() {
      return _react.default.createElement(_LinkSet.default, {
        collection: this.collection(),
        onLinkClick: this.props.onLinkClick
      });
    }
  }]);
  NavigationPanel.displayName = "NavigationPanel";
  return NavigationPanel;
}(_react.Component);

NavigationPanel.propTypes = {
  contextType: _propTypes.default.string.isRequired,
  contextId: _propTypes.default.string.isRequired,
  onLinkClick: _propTypes.default.func
};
var _default = NavigationPanel;
exports.default = _default;