react-toolbox/components/card/CardText.js

24 lines
555 B
JavaScript
Raw Normal View History

import React, { PropTypes, Component } from 'react';
2015-11-21 22:17:18 +03:00
import ClassNames from 'classnames';
import style from './style';
class CardText extends Component {
static propTypes = {
children: PropTypes.any,
2015-11-21 22:17:18 +03:00
className: PropTypes.string
2016-01-08 18:50:07 +03:00
};
render () {
const { children, className, ...other } = this.props;
2015-11-21 22:17:18 +03:00
const classes = ClassNames(style.cardText, className);
return (
<div className={classes} {...other}>
{typeof children === 'string' ? <p>{children}</p> : children}
</div>
);
}
}
export default CardText;