aboutsummaryrefslogtreecommitdiff
path: root/cmd/web/js/icon.jsx
blob: 53453bc26a7c921d17d60da3ba6af976ecc32b55 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import React from 'react';
import classnames from 'classnames';

class Icon extends React.Component {
  render = () => {
    var className = null;

    if (this.props.icon.startsWith('icon-')) {
      className = classnames(this.props.icon, this.props.className);
      return <i className={className}></i>;
    }

    className = classnames('bt', 'bt-' + this.props.icon, this.props.className);
    return <i className={className} aria-hidden="true"></i>;

  }
}

export default Icon;