import Ember from 'ember';
import layout from '../templates/components/lm-type-icon';

const { computed } = Ember;

export default Ember.Component.extend({
  layout,
  listItem: false,
  type: null,
  mimetype: null,
  tagName: 'span',
  classNames: ['lm-type-icon'],
  icon: computed('type', 'mimetype', function() {
    let type = this.get('type');
    let mimetype = this.get('mimetype') || '';
    if(type === 'link'){
      return 'fa-link';
    } else if(type === 'citation'){
      return 'fa-paragraph';
    } else {
      if(mimetype.search(/pdf/) !== -1){
        return 'fa-file-pdf-o';
      }
      if(mimetype.search(/ppt|keynote|pps|pptx|powerpoint/) !== -1){
        return 'fa-file-powerpoint-o';
      }
      if(mimetype.search(/mp4|mpg|mpeg|mov/) !== -1){
        return 'fa-file-movie-o';
      }
      if(mimetype.search(/wav|mp3|aac|flac/) !== -1){
        return 'fa-file-audio-o';
      }
    }
    return 'fa-file';
  })
});

@@ -430,19 +430,16 @@
 return '
-fa-
 link';%0A 
@@ -487,19 +487,16 @@
 return '
-fa-
 paragrap
@@ -565,27 +565,24 @@
     return '
-fa-
 file-pdf-o';
@@ -671,27 +671,24 @@
     return '
-fa-
 file-powerpo
@@ -769,27 +769,24 @@
     return '
-fa-
 file-movie-o
@@ -862,27 +862,24 @@
     return '
-fa-
 file-audio-o
@@ -911,11 +911,8 @@
 rn '
-fa-
 file

Remove deprecated fa- prefix from LM icons