UNPKG

673 BJavaScriptView Raw
1import React, {PureComponent} from 'react';
2import PropTypes from 'prop-types';
3import classNames from 'classnames';
4
5import styles from './list.css';
6
7export default class ListSeparator extends PureComponent {
8 static propTypes = {
9 className: PropTypes.string,
10 description: PropTypes.oneOfType([
11 PropTypes.element,
12 PropTypes.string
13 ]),
14 isFirst: PropTypes.bool
15 };
16
17 render() {
18 const {description, isFirst, className} = this.props;
19
20 const classes = classNames(styles.separator, className, {
21 [styles.separator_first]: isFirst
22 });
23
24 return (
25 <span
26 className={classes}
27 >{description}</span>
28 );
29 }
30}