import React from 'react'
import PropTypes from 'prop-types'
import _get from 'lodash/get'
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'
import {library} from '@fortawesome/fontawesome-svg-core'
import {
  faAngleDown, faAngleRight, faAngleLeft, faAngleUp, faStar as faStarFilled, faExclamation, faCheckCircle,
  faExternalLink, faPhone, faSquare
} from '@fortawesome/pro-solid-svg-icons'
import {
  faChevronDoubleLeft, faChevronDoubleRight, faChevronRight, faChevronLeft, faChevronUp, faChevronDown, faPlus,
  faFolders, faStar, faTimes, faArrowRight, faArrowLeft, faListUl, faFile, faFileAlt, faFileExcel, faFilePdf,
  faIdBadge, faCheck, faMapMarked, faSearch, faCog, faBars, faDownload, faUpload, faInfo, faCompress, faBook,
  faSortDown, faSortUp
} from '@fortawesome/pro-regular-svg-icons'
import {faTimes as faTimesLight, faCircle, faHorizontalRule, faSync} from '@fortawesome/pro-light-svg-icons'
import {faGoogle, faFacebook, faFacebookF, faDropbox, faMicrosoft, faJira, faApple}
  from '@fortawesome/free-brands-svg-icons'
(() => {
  library.add(
    faAngleDown, faAngleRight, faAngleLeft, faAngleUp, faChevronDoubleLeft, faChevronDoubleRight, faChevronRight,
    faChevronLeft, faChevronUp, faChevronDown, faPlus, faFolders, faStarFilled, faStar, faTimes, faArrowRight,
    faArrowLeft, faListUl, faFile, faFileAlt, faFileExcel, faFilePdf, faIdBadge, faCheck, faExclamation, faTimesLight,
    faCircle, faCheckCircle, faGoogle, faFacebook, faFacebookF, faDropbox, faMicrosoft, faJira, faApple, faBars,
    faExternalLink, faPhone, faMapMarked, faSearch, faCog, faDownload, faUpload, faInfo, faHorizontalRule, faSync,
    faSquare, faCompress, faBook, faSortUp, faSortDown)
})()

const FontAwesomeAdapter = ({icon, style}) =>
  <FontAwesomeIcon
    icon={icon.includes(',') ? icon.replace(/\s+/, '').split(',') : icon}
    style={style}
    {..._get(style, 'color') && {color: style.color}}
  />

FontAwesomeAdapter.propTypes = {
  icon: PropTypes.string.isRequired,
  style: PropTypes.object
}

export default FontAwesomeAdapter

@@ -616,27 +616,97 @@
 File
-Excel, faFilePdf,%0A 
+Code, faFileCsv,%0A  faFileExcel, faFileExport, faFileImport, faFilePdf, faFileSpreadsheet,
  faI
@@ -736,32 +736,34 @@
 arked, faSearch,
+%0A 
  faCog, faBars, 
@@ -811,18 +811,16 @@
  faBook,
-%0A 
  faSortD
@@ -1419,24 +1419,98 @@
 File
-Excel, faFilePdf
+Code, faFileCsv, faFileExcel, faFileExport, faFileImport, faFilePdf,%0A    faFileSpreadsheet
 , fa
@@ -1551,28 +1551,24 @@
 aTimesLight,
-%0A   
  faCircle, f
@@ -1594,32 +1594,36 @@
 gle, faFacebook,
+%0A   
  faFacebookF, fa
@@ -1668,20 +1668,16 @@
  faBars,
-%0A   
  faExter
@@ -1723,16 +1723,20 @@
 , faCog,
+%0A   
  faDownl
@@ -1783,20 +1783,16 @@
  faSync,
-%0A   
  faSquar

add new icons to FontAwesomeAdapter