"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: "\u0540\u0561\u0576\u0571\u0576\u0561\u0580\u0561\u0580\u0578\u0582\u0569\u0575\u0578\u0582\u0576\u0576\u0565\u0580"
            }, {
              href: "/courses/".concat(contextId, "/pages"),
              title: "\u0537\u057B\u0565\u0580"
            }, {
              href: "/courses/".concat(contextId, "/discussion_topics"),
              title: "\u0554\u0576\u0576\u0561\u0580\u056F\u0578\u0582\u0574\u0576\u0565\u0580"
            }, {
              href: "/courses/".concat(contextId, "/assignments/syllabus"),
              title: "\u0534\u0561\u057D\u0568\u0576\u0569\u0561\u0581\u056B \u056E\u0580\u0561\u0563\u056B\u0580"
            }, {
              href: "/courses/".concat(contextId, "/announcements"),
              title: "\u0540\u0561\u0575\u057F\u0561\u0580\u0561\u0580\u0578\u0582\u0569\u0575\u0578\u0582\u0576\u0576\u0565\u0580"
            }, {
              href: "/courses/".concat(contextId, "/quizzes"),
              title: "\u0539\u0565\u057D\u057F\u0565\u0580"
            }, {
              href: "/courses/".concat(contextId, "/files"),
              title: "\u0556\u0561\u0575\u056C\u0565\u0580"
            }, {
              href: "/courses/".concat(contextId, "/collaborations"),
              title: "\u0540\u0561\u0574\u0561\u057F\u0565\u0572 \u0561\u0577\u056D\u0561\u057F\u0561\u0576\u0584\u0576\u0565\u0580"
            }, {
              href: "/courses/".concat(contextId, "/grades"),
              title: "\u0533\u0576\u0561\u0570\u0561\u057F\u0561\u056F\u0561\u0576\u0576\u0565\u0580"
            }, {
              href: "/courses/".concat(contextId, "/users"),
              title: "\u0544\u0561\u0580\u0564\u056B\u056F"
            }, {
              href: "/courses/".concat(contextId, "/modules"),
              title: "\u0544\u0578\u0564\u0578\u0582\u056C\u0576\u0565\u0580"
            }]
          };

        case "group":
          return {
            links: [{
              href: "/groups/".concat(contextId, "/pages"),
              title: "\u054E\u056B\u056F\u056B\u056B \u057F\u0576\u0561\u0575\u056B\u0576 \u0567\u057B"
            }, {
              href: "/groups/".concat(contextId, "/discussion_topics"),
              title: "\u0554\u0576\u0576\u0561\u0580\u056F\u0578\u0582\u0574\u0576\u0565\u0580\u056B \u0581\u0578\u0582\u0581\u056B\u0579"
            }, {
              href: "/groups/".concat(contextId, "/announcements"),
              title: "\u0540\u0561\u0575\u057F\u0561\u0580\u0561\u0580\u0578\u0582\u0569\u0575\u0578\u0582\u0576\u0576\u0565\u0580\u056B \u0581\u0578\u0582\u0581\u0561\u056F"
            }, {
              href: "/groups/".concat(contextId, "/files"),
              title: "\u0556\u0561\u0575\u056C\u0565\u0580\u056B \u0581\u0578\u0582\u0581\u056B\u0579"
            }, {
              href: "/groups/".concat(contextId, "/collaborations"),
              title: "\u0540\u0561\u0574\u0561\u057F\u0565\u0572 \u0561\u0577\u056D\u0561\u057F\u0561\u0576\u0584\u0576\u0565\u0580"
            }, {
              href: "/groups/".concat(contextId, "/users"),
              title: "\u0544\u0561\u0580\u0564\u056B\u056F"
            }]
          };

        default:
          // user, TODO
          return {
            links: [{
              href: "/users/".concat(contextId, "/files"),
              title: "\u0556\u0561\u0575\u056C\u0565\u0580\u056B \u0581\u0578\u0582\u0581\u056B\u0579"
            }]
          };
      }
    }
  }, {
    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;