<commit_before>import React from 'react';
import moment from 'moment';
import AlertBox from '@department-of-veterans-affairs/formation-react/AlertBox';
import { pageNames } from './pageList';
import { EBEN_526_URL, BDD_INFO_URL } from '../../constants';

// TODO: Add in the dates for 180 and 90 days in the future
const dateFormat = 'MMMM DD, YYYY';
const ninetyDays = moment()
  .add(90, 'd')
  .format(dateFormat);
const oneHundredEightyDays = moment()
  .add(180, 'd')
  .format(dateFormat);

const alertContent = (
  <>
    <p>
      <strong>
        If your separation date is between {ninetyDays} and{' '}
        {oneHundredEightyDays}
      </strong>{' '}
      (90 and 180 days from today), you can file a disability claim through the
      Benefits Delivery at Discharge (BDD) program.
    </p>
    <p>
      <strong>If your separation date is before {ninetyDays},</strong> you can’t
      file a BDD claim, but you can still begin the process of filing your claim
      on eBenefits.
    </p>
    <a href={EBEN_526_URL} className="usa-button-primary va-button-primary">
      Go to eBenefits
    </a>
    <p>
      <a href={BDD_INFO_URL}>Learn more about the BDD program</a>
    </p>
  </>
);

const BDDPage = () => (
  <AlertBox
    status="error"
    headline="You’ll need to file a claim on eBenefits"
    content={alertContent}
  />
);

export default {
  name: pageNames.bdd,
  component: BDDPage,
};<commit_msg>Add missing GA event to track (#11694)<commit_after>import React from 'react';
import { connect } from 'react-redux';
import moment from 'moment';
import AlertBox from '@department-of-veterans-affairs/formation-react/AlertBox';
import { isLoggedIn as isLoggedInSelector } from 'platform/user/selectors';
import recordEvent from 'platform/monitoring/record-event';
import { pageNames } from './pageList';
import { EBEN_526_URL, BDD_INFO_URL } from '../../constants';

// TODO: Add in the dates for 180 and 90 days in the future
const dateFormat = 'MMMM DD, YYYY';
const ninetyDays = moment()
  .add(90, 'd')
  .format(dateFormat);
const oneHundredEightyDays = moment()
  .add(180, 'd')
  .format(dateFormat);

function alertContent(isLoggedIn) {
  return (
    <>
      <p>
        <strong>
          If your separation date is between {ninetyDays} and{' '}
          {oneHundredEightyDays}
        </strong>{' '}
        (90 and 180 days from today), you can file a disability claim through
        the Benefits Delivery at Discharge (BDD) program.
      </p>
      <p>
        <strong>If your separation date is before {ninetyDays},</strong> you
        can’t file a BDD claim, but you can still begin the process of filing
        your claim on eBenefits.
      </p>
      <a
        href={EBEN_526_URL}
        className="usa-button-primary va-button-primary"
        onClick={() =>
          isLoggedIn && recordEvent({ event: 'nav-ebenefits-click' })
        }
      >
        Go to eBenefits
      </a>
      <p>
        <a href={BDD_INFO_URL}>Learn more about the BDD program</a>
      </p>
    </>
  );
}

const BDDPage = ({ isLoggedIn }) => (
  <AlertBox
    status="error"
    headline="You’ll need to file a claim on eBenefits"
    content={alertContent(isLoggedIn)}
  />
);

const mapStateToProps = state => ({
  isLoggedIn: isLoggedInSelector(state),
});

export default {
  name: pageNames.bdd,
  component: connect(mapStateToProps)(BDDPage),
};
{'fraction_non_alphanumeric': 0.12603305785123967, 'fraction_numerical': 0.013872491145218418, 'mean_word_length': 3.0106508875739646, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '370893', 'n_tokens_mistral': 1166, 'n_tokens_neox': 1099, 'n_words': 332}