<commit_before>import _ from 'lodash';
import React from 'react';
import moment from 'moment';
import { connect } from 'react-redux';
import Scroll from 'react-scroll';
import appendQuery from 'append-query';

import { focusElement } from '../../../../platform/utilities/ui';
import isBrandConsolidationEnabled from '../../../../platform/brand-consolidation/feature-flag';

const propertyName = isBrandConsolidationEnabled() ? 'VA.gov' : 'Vets.gov';
const scroller = Scroll.scroller;
const scrollToTop = () => {
  scroller.scrollTo('topScrollElement', {
    duration: 500,
    delay: 0,
    smooth: true,
  });
};
const nextQuery = { next: window.location.pathname };
const url1990 = appendQuery(
  '/education/apply-for-education-benefits/application/1990',
  nextQuery,
);

class ConfirmationPage extends React.Component {
  constructor(props) {
    super(props);
    this.state = { isExpanded: false };
    this.handleClick = this.handleClick.bind(this);
  }

  componentDidMount() {
    focusElement('.confirmation-page-title');
    scrollToTop();
  }

  handleClick(e) {
    e.preventDefault();
    this.setState({ isExpanded: !this.state.isExpanded });
  }

  render() {
    const form = this.props.form;
    const response = this.props.form.submission.response
      ? this.props.form.submission.response.attributes
      : {};
    const name = form.data.applicantFullName;

    return (
      <div>
        <h3 className="confirmation-page-title">
          Your claim has been received
        </h3>
        <p>
          We usually process claims within <strong>30 days</strong>.
        </p>
        <p>
          We may contact you for more information or documents.
          <br />
          <i>Please print this page for your records.</i>
        </p>
        <div className="inset">
          <h4>
            Education Claim <span className="additional">(Form 22-0994)</span>
          </h4>
          <span>
            for {name && name.first} {name && name.middle} {name && name.last}{' '}
            {name && name.suffix}
          </span>

          <ul className="claim-list">
            <li>
              <strong>Confirmation number</strong>
              <br />
              <span>{response.confirmationNumber}</span>
            </li>
            <li>
              <strong>Date received</strong>
              <br />
              <span>
                {moment(form.submission.submittedAt).format('MMM D, YYYY')}
              </span>
            </li>
            <li>
              <strong>Your claim was sent to</strong>
              <br />
              <address className="schemaform-address-view">
                {response.regionalOffice}
              </address>
            </li>
          </ul>
        </div>
        {!_.get(form.data, 'appliedForVaEducationBenefits', true) && (
          <div>
            <p>
              <strong>{'Note: '}</strong>
              We’ll also need you to complete the Application for VA Education
              Benefits (VA Form 22-1990) to determine your eligibility for VET<commit_msg>Bah 17751 (#9879)<commit_after>import _ from 'lodash';
import React from 'react';
import moment from 'moment';
import { connect } from 'react-redux';
import Scroll from 'react-scroll';
import appendQuery from 'append-query';

import { focusElement } from '../../../../platform/utilities/ui';
import isBrandConsolidationEnabled from '../../../../platform/brand-consolidation/feature-flag';
import AlertBox from '@department-of-veterans-affairs/formation-react/AlertBox';

const propertyName = isBrandConsolidationEnabled() ? 'VA.gov' : 'Vets.gov';
const scroller = Scroll.scroller;
const scrollToTop = () => {
  scroller.scrollTo('topScrollElement', {
    duration: 500,
    delay: 0,
    smooth: true,
  });
};
const nextQuery = { next: window.location.pathname };
const url1990 = appendQuery(
  '/education/apply-for-education-benefits/application/1990',
  nextQuery,
);

class ConfirmationPage extends React.Component {
  constructor(props) {
    super(props);
    this.state = { isExpanded: false };
    this.handleClick = this.handleClick.bind(this);
  }

  componentDidMount() {
    focusElement('.confirmation-page-title');
    scrollToTop();
  }

  handleClick(e) {
    e.preventDefault();
    this.setState({ isExpanded: !this.state.isExpanded });
  }

  render() {
    const form = this.props.form;
    const response = this.props.form.submission.response
      ? this.props.form.submission.response.attributes
      : {};
    const name = form.data.applicantFullName;
    const appliedForVaEducationBenefits = _.get(
      form.data,
      'appliedForVaEducationBenefits',
      true,
    );
    return (
      <div>
        <h3 className="confirmation-page-title">
          Your claim has been received
        </h3>
        <p>
          We usually process claims within <strong>30 days</strong>.
        </p>
        <p>
          We may contact you for more information or documents.
          <br />
          <i>Please print this page for your records.</i>
        </p>
        <AlertBox
          isVisible={!appliedForVaEducationBenefits}
          status="warning"
          headline="Don’t forget to apply for VA education benefits"
          content={
            <span>
              Now that you've submitted your application for VET TEC, you’ll
              need to complete an Application for VA Education Benefits (VA Form
              22-1990). Click the button on the bottom of this page to go to
              that application.
            </span>
          }
        />
        <div className="inset">
          <h4>
            Education Claim <span className="additional">(Form 22-0994)</span>
          </h4>
          <span>
            for {name && name.first} {name && name.middle} {name && name.last}{' '}
            {name && name.suffix}
          </span>

          <ul className="claim-list">
            <li>
              <strong>Confirmation number</strong>
              <br />
              <span>{response.confirmationNumber}</span>
            </li>
            <li>
              <strong>Date received</strong>
              <br />
              <span>
                {moment(form.submission.submittedAt).format('MMM D, YYYY')}
              </span>
            </li>
            <li>
              <strong>Your claim was sent to</strong>
              <br />
              <address className="schemaform-address-view">
                {response.regionalOffice}
              </address>
            </li>
          </ul>
        </div>
        {!appliedForVaEducationBenefits && (
          <div>
            <p>
              <strong>{'Note: '}</strong>
              We’ll also need you to complete the Application for VA Education
              Benefits (VA Form 22-1990) to determine your eligibility for VET
{'fraction_non_alphanumeric': 0.12792740046838408, 'fraction_numerical': 0.010977751756440281, 'mean_word_length': 1.9982448442299254, 'pattern_counts': {'":': 0, '<': 100, '<?xml version=': 0, '>': 102, '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': '3872542', 'n_tokens_mistral': 2005, 'n_tokens_neox': 1894, 'n_words': 469}