"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getAccept = getAccept;
exports.getBase64 = getBase64;
function getBase64(file) {
  return new Promise(function (resolve) {
    var reader = new FileReader();
    reader.readAsDataURL(file);
    reader.onload = function () {
      return resolve({
        status: 'success',
        url: reader.result
      });
    };
    reader.onerror = function (error) {
      return resolve({
        status: 'error',
        error: error
      });
    };
  });
}
function getAccept(fileType) {
  switch (fileType) {
    case 'image':
      return '.jpg,.png';
    case 'svg':
      return '.svg';
    case 'office':
      return '.doc,.docx,.pdf,.xls,.xlsx';
    case 'zip':
      return '.rar,.zip';
    default:
      // return '.rar,.zip,.doc,.docx,.pdf,.jpg,.png';
      return '*';
  }
}