import * as React from 'react';
import {HTMLProps, PureComponent} from 'react';

export interface IconProps extends HTMLProps<HTMLElement> {
  name: string;
}

export class Icon extends PureComponent<IconProps, {}> {
  render() {
    const {className, ...otherProps} = this.props;
    const cssClasses = `material-icons ${className || ''}`.trim();

    return (
      <i className={cssClasses} {...otherProps}>{this.props.name}</i>
    );
  }
}
