| Total Complexity | 1 |
| Complexity/F | 1 |
| Lines of Code | 29 |
| Function Count | 1 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | import React from 'react'; |
||
| 2 | import { Card } from 'reactstrap'; |
||
| 3 | import classnames from 'classnames'; |
||
| 4 | import PropTypes from 'prop-types'; |
||
| 5 | |||
| 6 | 2 | const DEFAULT_MARGIN_SIZE = 4; |
|
| 7 | 2 | const propTypes = { |
|
| 8 | marginSize: PropTypes.number, |
||
| 9 | children: PropTypes.node, |
||
| 10 | }; |
||
| 11 | |||
| 12 | export default function MutedMessage({ children, marginSize = DEFAULT_MARGIN_SIZE }) { |
||
| 13 | 5 | const cardClasses = classnames('bg-light', { |
|
| 14 | [`mt-${marginSize}`]: marginSize > 0, |
||
| 15 | }); |
||
| 16 | |||
| 17 | 5 | return ( |
|
| 18 | <div className="col-md-10 offset-md-1"> |
||
| 19 | <Card className={cardClasses} body> |
||
| 20 | <h3 className="text-center text-muted mb-0"> |
||
| 21 | {children} |
||
| 22 | </h3> |
||
| 23 | </Card> |
||
| 24 | </div> |
||
| 25 | ); |
||
| 26 | } |
||
| 27 | |||
| 28 | MutedMessage.propTypes = propTypes; |
||
| 29 |