| 1 |
import React from 'react'; |
| 2 |
import SVG from 'react-inlinesvg'; |
| 3 |
|
| 4 |
import IconManage from '../../../icons/template/manage.svg'; |
| 5 |
import IconProperties from '../../../icons/template/properties.svg'; |
| 6 |
import IconBlocks from '../../../icons/template/blocks.svg'; |
| 7 |
import IconAdd from '../../../icons/template/add.svg'; |
| 8 |
import IconRemove from '../../../icons/template/remove.svg'; |
| 9 |
import IconHTML from '../../../icons/template/html.svg'; |
| 10 |
import IconCSS from '../../../icons/template/css.svg'; |
| 11 |
|
| 12 |
const icons = { |
| 13 |
manage: IconManage, |
| 14 |
properties: IconProperties, |
| 15 |
blocks: IconBlocks, |
| 16 |
add: IconAdd, |
| 17 |
remove: IconRemove, |
| 18 |
html: IconHTML, |
| 19 |
css: IconCSS, |
| 20 |
}; |
| 21 |
|
| 22 |
const Icon = (props) => { |
| 23 |
let icon = icons.hasOwnProperty(props.type) ? icons[props.type] : false; |
| 24 |
|
| 25 |
if ( !icon ) { |
| 26 |
return <span className="wpupg-template-noicon"> </span>; |
| 27 |
} |
| 28 |
|
| 29 |
return ( |
| 30 |
<span className='wpupg-template-icon'> |
| 31 |
<SVG |
| 32 |
src={icon} |
| 33 |
/> |
| 34 |
</span> |
| 35 |
); |
| 36 |
} |
| 37 |
export default Icon; |