"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: "\u0417\u0430\u0434\u0430\u043D\u0438\u044F"
            }, {
              href: "/courses/".concat(contextId, "/pages"),
              title: "\u0421\u0442\u0440\u0430\u043D\u0438\u0446\u044B"
            }, {
              href: "/courses/".concat(contextId, "/discussion_topics"),
              title: "\u041E\u0431\u0441\u0443\u0436\u0434\u0435\u043D\u0438\u044F"
            }, {
              href: "/courses/".concat(contextId, "/assignments/syllabus"),
              title: "\u0421\u043E\u0434\u0435\u0440\u0436\u0430\u043D\u0438\u0435 \u043A\u0443\u0440\u0441\u0430"
            }, {
              href: "/courses/".concat(contextId, "/announcements"),
              title: "\u041E\u0431\u044A\u044F\u0432\u043B\u0435\u043D\u0438\u044F"
            }, {
              href: "/courses/".concat(contextId, "/quizzes"),
              title: "\u041A\u043E\u043D\u0442\u0440\u043E\u043B\u044C\u043D\u044B\u0435 \u0440\u0430\u0431\u043E\u0442\u044B"
            }, {
              href: "/courses/".concat(contextId, "/files"),
              title: "\u0424\u0430\u0439\u043B\u044B"
            }, {
              href: "/courses/".concat(contextId, "/collaborations"),
              title: "\u0421\u043E\u0432\u043C\u0435\u0441\u0442\u043D\u044B\u0435 \u0440\u0430\u0431\u043E\u0442\u044B"
            }, {
              href: "/courses/".concat(contextId, "/grades"),
              title: "\u0411\u0430\u043B\u043B\u044B"
            }, {
              href: "/courses/".concat(contextId, "/users"),
              title: "\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u0438"
            }, {
              href: "/courses/".concat(contextId, "/modules"),
              title: "\u041C\u043E\u0434\u0443\u043B\u0438"
            }]
          };

        case "group":
          return {
            links: [{
              href: "/groups/".concat(contextId, "/pages"),
              title: "\u0414\u043E\u043C\u0430\u0448\u043D\u044F\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430 \u0432\u0438\u043A\u0438"
            }, {
              href: "/groups/".concat(contextId, "/discussion_topics"),
              title: "\u0418\u043D\u0434\u0435\u043A\u0441 \u043E\u0431\u0441\u0443\u0436\u0434\u0435\u043D\u0438\u0439"
            }, {
              href: "/groups/".concat(contextId, "/announcements"),
              title: "\u0421\u043F\u0438\u0441\u043E\u043A \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D\u0438\u0439"
            }, {
              href: "/groups/".concat(contextId, "/files"),
              title: "\u0418\u043D\u0434\u0435\u043A\u0441 \u0444\u0430\u0439\u043B\u043E\u0432"
            }, {
              href: "/groups/".concat(contextId, "/collaborations"),
              title: "\u0421\u043E\u0432\u043C\u0435\u0441\u0442\u043D\u044B\u0435 \u0440\u0430\u0431\u043E\u0442\u044B"
            }, {
              href: "/groups/".concat(contextId, "/users"),
              title: "\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u0438"
            }]
          };

        default:
          // user, TODO
          return {
            links: [{
              href: "/users/".concat(contextId, "/files"),
              title: "\u0418\u043D\u0434\u0435\u043A\u0441 \u0444\u0430\u0439\u043B\u043E\u0432"
            }]
          };
      }
    }
  }, {
    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;