<commit_before>import React from 'react';

import ErrorableRadioButtons from '../../../common/components/form-elements/ErrorableRadioButtons';
import DateInput from '../../../common/components/form-elements/DateInput';
import { validateIfDirty, isNotBlank, validateIfDirtyDateObj, isValidRelinquishedDate } from '../../utils/validations';
import { relinquishableBenefits } from '../../utils/options-for-select';
import { showRelinquishedEffectiveDate } from '../../utils/helpers';

export default class BenefitsRelinquishmentFields extends React.Component {
  render() {
    const dateFields = (
      <div>
        <DateInput required={showRelinquishedEffectiveDate(this.props.data.benefitsRelinquished.value)}
            allowFutureDates
            errorMessage="Date cannot be earlier than 2 years ago"
            validation={validateIfDirtyDateObj(this.props.data.benefitsRelinquishedDate, isValidRelinquishedDate)}
            label="Effective date"
            name="benefitsRelinquishedDate"
            day={this.props.data.benefitsRelinquishedDate.day}
            month={this.props.data.benefitsRelinquishedDate.month}
            year={this.props.data.benefitsRelinquishedDate.year}
            onValueChange={(update) => {this.props.onStateChange('benefitsRelinquishedDate', update);}}/>
        <div>
          <ul>
            <li>Use today’s date unless you aren’t going to use your Post 9/11 GI Bill benefits until later.</li>
            <li>If you pick a future date, you can’t get benefits until then.</li>
            <li>If your classes started less than 2 years ago, enter the date they began.</li>
          </ul>
        </div>
      </div>
    );

    // nest DateInputs inside radio buttons
    const options = relinquishableBenefits.map((benefit) => {
      const option = Object.assign({}, benefit);
      if (benefit.value !== 'unknown') {
        if (benefit.additional) {
          option.additional = (
            <div>
              <p>{benefit.additional}</p>
              {dateFields}<commit_msg>Adding warning style to legalese messages<commit_after>import React from 'react';

import ErrorableRadioButtons from '../../../common/components/form-elements/ErrorableRadioButtons';
import DateInput from '../../../common/components/form-elements/DateInput';
import { validateIfDirty, isNotBlank, validateIfDirtyDateObj, isValidRelinquishedDate } from '../../utils/validations';
import { relinquishableBenefits } from '../../utils/options-for-select';
import { showRelinquishedEffectiveDate } from '../../utils/helpers';

export default class BenefitsRelinquishmentFields extends React.Component {
  render() {
    const dateFields = (
      <div>
        <DateInput required={showRelinquishedEffectiveDate(this.props.data.benefitsRelinquished.value)}
            allowFutureDates
            errorMessage="Date cannot be earlier than 2 years ago"
            validation={validateIfDirtyDateObj(this.props.data.benefitsRelinquishedDate, isValidRelinquishedDate)}
            label="Effective date"
            name="benefitsRelinquishedDate"
            day={this.props.data.benefitsRelinquishedDate.day}
            month={this.props.data.benefitsRelinquishedDate.month}
            year={this.props.data.benefitsRelinquishedDate.year}
            onValueChange={(update) => {this.props.onStateChange('benefitsRelinquishedDate', update);}}/>
        <div>
          <ul>
            <li>Use today’s date unless you aren’t going to use your Post 9/11 GI Bill benefits until later.</li>
            <li>If you pick a future date, you can’t get benefits until then.</li>
            <li>If your classes started less than 2 years ago, enter the date they began.</li>
          </ul>
        </div>
      </div>
    );

    // nest DateInputs inside radio buttons
    const options = relinquishableBenefits.map((benefit) => {
      const option = Object.assign({}, benefit);
      if (benefit.value !== 'unknown') {
        if (benefit.additional) {
          option.additional = (
            <div>
              <div className="usa-alert usa-alert-warning usa-content secondary">
                <div className="usa-alert-body">
                  <span>{benefit.additional}</span>
                </div>
              </div>
              {dateFields}
{'fraction_non_alphanumeric': 0.1176196032672112, 'fraction_numerical': 0.002333722287047841, 'mean_word_length': 2.7302001740644037, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 43, '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': '3406991', 'n_tokens_mistral': 1213, 'n_tokens_neox': 1151, 'n_words': 271}