1 | import React from 'react';
|
2 | import PropTypes from 'prop-types';
|
3 | import classNames from 'classnames';
|
4 | import { mapToCssModules, tagPropType } from './utils';
|
5 |
|
6 | const propTypes = {
|
7 | tag: tagPropType,
|
8 | className: PropTypes.string,
|
9 | cssModule: PropTypes.object,
|
10 | };
|
11 |
|
12 | const defaultProps = {
|
13 | tag: 'div'
|
14 | };
|
15 |
|
16 | const CardSubtitle = (props) => {
|
17 | const {
|
18 | className,
|
19 | cssModule,
|
20 | tag: Tag,
|
21 | ...attributes
|
22 | } = props;
|
23 | const classes = mapToCssModules(classNames(
|
24 | className,
|
25 | 'card-subtitle'
|
26 | ), cssModule);
|
27 |
|
28 | return (
|
29 | <Tag {...attributes} className={classes} />
|
30 | );
|
31 | };
|
32 |
|
33 | CardSubtitle.propTypes = propTypes;
|
34 | CardSubtitle.defaultProps = defaultProps;
|
35 |
|
36 | export default CardSubtitle;
|