"use strict";

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

var _forms_attachment_excel3x = _interopRequireDefault(require("../../images/forms_attachment_excel@3x.png"));

var _forms_attachment_image3x = _interopRequireDefault(require("../../images/forms_attachment_image@3x.png"));

var _forms_attachment_key3x = _interopRequireDefault(require("../../images/forms_attachment_key@3x.png"));

var _forms_attachment_moive3x = _interopRequireDefault(require("../../images/forms_attachment_moive@3x.png"));

var _forms_attachment_music3x = _interopRequireDefault(require("../../images/forms_attachment_music@3x.png"));

var _forms_attachment_number3x = _interopRequireDefault(require("../../images/forms_attachment_number@3x.png"));

var _forms_attachment_other3x = _interopRequireDefault(require("../../images/forms_attachment_other@3x.png"));

var _forms_attachment_pages3x = _interopRequireDefault(require("../../images/forms_attachment_pages@3x.png"));

var _forms_attachment_pdf3x = _interopRequireDefault(require("../../images/forms_attachment_pdf@3x.png"));

var _forms_attachment_ppt3x = _interopRequireDefault(require("../../images/forms_attachment_ppt@3x.png"));

var _forms_attachment_rar3x = _interopRequireDefault(require("../../images/forms_attachment_rar@3x.png"));

var _forms_attachment_rtf3x = _interopRequireDefault(require("../../images/forms_attachment_rtf@3x.png"));

var _forms_attachment_txt3x = _interopRequireDefault(require("../../images/forms_attachment_txt@3x.png"));

var _forms_attachment_word3x = _interopRequireDefault(require("../../images/forms_attachment_word@3x.png"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

// 通过文件名称获取对应文件类型的icon
var getIconByFileName = function getIconByFileName() {
  var fileName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  var fileType = fileName.replace(/^.+\.([^.]+)$/, '$1').toLowerCase();

  switch (fileType) {
    case 'rar':
    case 'zip':
    case 'tar':
    case 'bz2':
    case 'gz':
    case '7z':
      return _forms_attachment_rar3x["default"];

    case 'doc':
    case 'docx':
      return _forms_attachment_word3x["default"];

    case 'pages':
      return _forms_attachment_pages3x["default"];

    case 'ppt':
    case 'pptx':
      return _forms_attachment_ppt3x["default"];

    case 'keynote':
      return _forms_attachment_key3x["default"];

    case 'xls':
    case 'xlsx':
      return _forms_attachment_excel3x["default"];

    case 'numbers':
      return _forms_attachment_number3x["default"];

    case 'pdf':
      return _forms_attachment_pdf3x["default"];

    case 'txt':
      return _forms_attachment_txt3x["default"];

    case 'rtf':
      return _forms_attachment_rtf3x["default"];

    case 'jpg':
    case 'jpeg':
    case 'png':
    case 'gif':
      return _forms_attachment_image3x["default"];

    case 'mp3':
      return _forms_attachment_music3x["default"];

    case 'mp4':
    case 'mov':
      return _forms_attachment_moive3x["default"];

    default:
      return _forms_attachment_other3x["default"];
  }
};

var _default = getIconByFileName;
exports["default"] = _default;
module.exports = exports.default;