department-of-veterans-affairs/vets-website

View on GitHub
src/applications/simple-forms/form-upload/components/EditLink.jsx

Summary

Maintainability
A
0 mins
Test Coverage
import React from 'react';
import PropTypes from 'prop-types';
import { withRouter } from 'react-router';
import { VaLink } from '@department-of-veterans-affairs/component-library/dist/react-bindings';

const EditLink = ({ href, router }) => {
  function onClick(e) {
    e.preventDefault();
    router.push(href);
  }

  return <VaLink href={href} onClick={onClick} text="Edit" />;
};

export default withRouter(EditLink);

EditLink.propTypes = {
  href: PropTypes.string,
  router: PropTypes.object,
};