blob: 6ce76cf91a57b7fd36975fff090470241a12bb2e [file] [log] [blame]
az2497644017c2017-08-10 17:49:40 +03001import React from 'react';
2//import ReactDOMServer from 'react-dom/server';
3
4const SVGIcon = ({name, onClick, label, className, iconClassName, labelClassName, labelPosition, color, disabled, ...other}) => {
5 let colorClass = (color !== '') ? '__' + color : '';
6 let classes = `svg-icon-wrapper ${iconClassName} ${className} ${colorClass} ${onClick ? 'clickable' : ''} ${disabled ? 'disabled' : ''} ${labelPosition}`;
7
8 let iconMock = (
9 <div {...other} onClick={onClick} className={classes}>
10 <span className={`svg-icon __${name} ${disabled ? 'disabled' : ''}`} />
11 {label && <span className={`svg-icon-label ${labelClassName}`}>{label}</span>}
12 </div>
13 );
14// console.log(ReactDOMServer.renderToStaticMarkup(iconMock));
15 return iconMock;
16};
17export default SVGIcon;