Lidarr/frontend/src/Components/Icon.js

45 lines
746 B
JavaScript
Raw Normal View History

2017-09-04 02:20:56 +00:00
import PropTypes from 'prop-types';
import React from 'react';
import { kinds } from 'Helpers/Props';
import classNames from 'classnames';
import styles from './Icon.css';
function Icon(props) {
const {
className,
name,
kind,
size,
title
} = props;
return (
2017-10-02 03:05:28 +00:00
<i
2017-09-04 02:20:56 +00:00
className={classNames(
name,
className,
styles[kind]
)}
title={title}
style={{
fontSize: `${size}px`
}}
2017-10-07 06:21:06 +00:00
/>
2017-09-04 02:20:56 +00:00
);
}
Icon.propTypes = {
className: PropTypes.string,
name: PropTypes.string.isRequired,
kind: PropTypes.string.isRequired,
size: PropTypes.number.isRequired,
title: PropTypes.string
};
Icon.defaultProps = {
kind: kinds.DEFAULT,
size: 14
};
export default Icon;