UNPKG

708 BJavaScriptView Raw
1import React from 'react';
2import PropTypes from 'prop-types';
3import classNames from 'classnames';
4import { mapToCssModules, tagPropType } from './utils';
5
6const propTypes = {
7 /** Add custom class */
8 className: PropTypes.string,
9 /** Change underlying component's CSS base class name */
10 cssModule: PropTypes.object,
11 /** Set a custom element for this component */
12 tag: tagPropType,
13};
14
15function CardText(props) {
16 const { className, cssModule, tag: Tag = 'p', ...attributes } = props;
17 const classes = mapToCssModules(
18 classNames(className, 'card-text'),
19 cssModule,
20 );
21
22 return <Tag {...attributes} className={classes} />;
23}
24
25CardText.propTypes = propTypes;
26
27export default CardText;
28
\No newline at end of file