<commit_before>/**
* AddDataHeader.jsx
* Created by <NAME> 2/19/16
**/

import React from 'react';
import moment from 'moment';

import * as ReviewHelper from '../../helpers/reviewHelper.js';

class LastUpdated extends React.Component {
    constructor(props){
        super(props);
    }
    
    render() {
        return (
            <div className="col-md-5 mt-40 mb-50 last-updated">
                <p>Last Saved: {this.props.last_updated}</p>
            </div>
        );
    }
}

export default class AddDataHeader extends React.Component {
    constructor(props) {
        super(props);

        this.state = {
            submissionID: null,
            last_updated: null,
            ready: false
        };
    }

    componentDidMount() {
        if (this.props.submissionID != null) {
            ReviewHelper.fetchStatus(this.props.submissionID)
                .then((data) => {
                    data.ready = true;
                    this.setState(data);
                })
                .catch((error) => {
                    console.log(error);
                });
        }
    }

    render() {
        let lastUpdated = null;
        if (this.state.ready && this.state.last_updated){
            let formattedTime = moment.utc(this.state.last_updated).local().format('h:mm a');
            lastUpdated = <LastUpdated last_updated={formattedTime} />
        }

        return (
            <div className="usa-da-content-dark">
                <div className="container">
                    <div className="row usa-da-content-add-data usa-da-page-title">
                        <div className="col-md-10 mt-40 mb-20">
                            <div className="display-2">Upload & Validate a New Submission</div>
                            <p>The current DATA Act Broker allows agencies to upload and test their data as it is required under the DATA Act. It is not connected to USAspending.</p>
                        </div>
                        {lastUpdated}
                    </div>
                </div>
            </div>
        );
    }
}<commit_msg>Bug fix: correct the positioning of "last saved"<commit_after>/**
* AddDataHeader.jsx
* Created by Kyle Fox 2/19/16
**/

import React from 'react';
import moment from 'moment';

import * as ReviewHelper from '../../helpers/reviewHelper.js';

class LastUpdated extends React.Component {
    constructor(props){
        super(props);
    }
    
    render() {
        return (
            <div className="col-md-4 mt-40 mb-50 last-updated">
                <p>Last Saved: {this.props.last_updated}</p>
            </div>
        );
    }
}

export default class AddDataHeader extends React.Component {
    constructor(props) {
        super(props);

        this.state = {
            submissionID: null,
            last_updated: null,
            ready: false
        };
    }

    componentDidMount() {
        if (this.props.submissionID != null) {
            ReviewHelper.fetchStatus(this.props.submissionID)
                .then((data) => {
                    data.ready = true;
                    this.setState(data);
                })
                .catch((error) => {
                    console.log(error);
                });
        }
    }

    render() {
        let lastUpdated = null;
        if (this.state.ready && this.state.last_updated){
            let formattedTime = moment.utc(this.state.last_updated).local().format('h:mm a');
            lastUpdated = <LastUpdated last_updated={formattedTime} />
        }

        return (
            <div className="usa-da-content-dark">
                <div className="container">
                    <div className="row usa-da-content-add-data usa-da-page-title">
                        <div className="col-md-8 mt-40 mb-20">
                            <div className="display-2">Upload & Validate a New Submission</div>
                            <p>The current DATA Act Broker allows agencies to upload and test their data as it is required under the DATA Act. It is not connected to USAspending.</p>
                        </div>
                        {lastUpdated}
                    </div>
                </div>
            </div>
        );
    }
}
{'fraction_non_alphanumeric': 0.11749408983451537, 'fraction_numerical': 0.007801418439716312, 'mean_word_length': 1.4699357851722126, 'pattern_counts': {'":': 0, '<': 38, '<?xml version=': 0, '>': 42, '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': '2640107', 'n_tokens_mistral': 1161, 'n_tokens_neox': 1114, 'n_words': 262}