department-of-veterans-affairs/vets-website

View on GitHub
src/applications/edu-benefits/10203/components/ExitApplicationButton.jsx

Summary

Maintainability
A
0 mins
Test Coverage
import React from 'react';
import { removeFormApi } from 'platform/forms/save-in-progress/api';
import captureEvents from '../analytics-functions';

export const ExitApplicationButton = ({ formId, isLoggedIn }) => {
  const onClick = () => {
    captureEvents.exitApplication();

    if (isLoggedIn) {
      removeFormApi(formId);
    }
  };

  return (
    <a
      className="vads-c-action-link--green"
      href="/education/"
      onClick={onClick}
    >
      Exit application
    </a>
  );
};