mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-02-27 04:06:39 +00:00
20 lines
406 B
JavaScript
20 lines
406 B
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
|
|
const propTypes = {
|
|
href: PropTypes.string.isRequired,
|
|
children: PropTypes.node,
|
|
};
|
|
|
|
export default function ExternalLink(props) {
|
|
const { href, children, ...rest } = props;
|
|
|
|
return (
|
|
<a target="_blank" rel="noopener noreferrer" href={href} {...rest}>
|
|
{children || href}
|
|
</a>
|
|
);
|
|
}
|
|
|
|
ExternalLink.propTypes = propTypes;
|