import React from 'react';
import classNames from 'classnames';
import {FormattedMessage} from 'react-intl';
import CopyableIcon from './CopyableIcon';
import IconConfig from './IconConfig';

export default class IconSet extends React.Component {
  static defaultProps = {
    icons: []
  }

  icons = IconConfig;

  // Show badges
  newIcons = [
  ];

  render() {
    const {className, category} = this.props;
    const listClassName = classNames({
      'anticons-list': true,
      clearfix: true,
      [className]: !!className
    });
    return (
      <div id='site-download-iconfont-page'>
        <a href={`/iconfont/${category}.zip`}><FormattedMessage id='app.api.download-iconfont' /></a>
        <ul className={listClassName}>
          {this.icons[category].map(type => (
            <CopyableIcon key={type} type={type} category={category} isNew={this.newIcons.indexOf(type) >= 0} />
          ))}
        </ul>
      </div>
    );
  }
}
