(props)
| 24 | }; |
| 25 | |
| 26 | function Badge(props) { |
| 27 | let { |
| 28 | className, |
| 29 | cssModule, |
| 30 | color = 'secondary', |
| 31 | innerRef, |
| 32 | pill = false, |
| 33 | tag: Tag = 'span', |
| 34 | ...attributes |
| 35 | } = props; |
| 36 | |
| 37 | const classes = mapToCssModules( |
| 38 | classNames( |
| 39 | className, |
| 40 | 'badge', |
| 41 | 'bg-' + color, |
| 42 | pill ? 'rounded-pill' : false, |
| 43 | ), |
| 44 | cssModule, |
| 45 | ); |
| 46 | |
| 47 | if (attributes.href && Tag === 'span') { |
| 48 | Tag = 'a'; |
| 49 | } |
| 50 | |
| 51 | return <Tag {...attributes} className={classes} ref={innerRef} />; |
| 52 | } |
| 53 | |
| 54 | Badge.propTypes = propTypes; |
| 55 |
nothing calls this directly
no test coverage detected
searching dependent graphs…