| Total Complexity | 1 |
| Complexity/F | 1 |
| Lines of Code | 20 |
| Function Count | 1 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Coverage | 50% |
| Changes | 0 | ||
| 1 | import React from 'react'; |
||
| 2 | import PropTypes from 'prop-types'; |
||
| 3 | |||
| 4 | 7 | const propTypes = { |
|
| 5 | href: PropTypes.string.isRequired, |
||
| 6 | children: PropTypes.node, |
||
| 7 | }; |
||
| 8 | |||
| 9 | export default function ExternalLink(props) { |
||
| 10 | const { href, children, ...rest } = props; |
||
| 11 | |||
| 12 | return ( |
||
| 13 | <a target="_blank" rel="noopener noreferrer" href={href} {...rest}> |
||
| 14 | {children || href} |
||
| 15 | </a> |
||
| 16 | ); |
||
| 17 | } |
||
| 18 | |||
| 19 | ExternalLink.propTypes = propTypes; |
||
| 20 |