cnap-cobre/synapse

View on GitHub
frontend/src/components/Modal/shared_components/LinkComponent.js

Summary

Maintainability
A
0 mins
Test Coverage
// @flow
import * as React from 'react';
 
type LinkProps = {
to?: string,
children?: React.Node,
onClick(string): typeof undefined,
}
 
const LinkComponent = (props: LinkProps) => {
const { onClick, to, children } = props;
return (
<a onClick={() => {
if (to !== undefined) {
onClick(to);
}
}}
>
{children}
</a>
);
};
 
LinkComponent.defaultProps = {
to: '',
children: null,
};
 
export default LinkComponent;