{"size": 1343, "ext": "js", "max_stars_repo_path": "src/pages/AssessmentTool/Hydration/hydrationIntake.js", "max_stars_repo_name": "abi-fisher/abi-fisher.github.io", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/pages/AssessmentTool/Hydration/hydrationIntake.js", "max_issues_repo_name": "abi-fisher/abi-fisher.github.io", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/pages/AssessmentTool/Hydration/hydrationIntake.js", "max_forks_repo_name": "abi-fisher/abi-fisher.github.io", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.0163934426, "max_line_length": 78, "alphanum_fraction": 0.5599404319}
import React from "react"

const unselected = "btn btn-primary";

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

    this.state={
        question: "hydrationIntake",
        answer: null,
        identified:null,
    };
  }

  handleAnswer(answer){
    this.setState({
      answer: answer,
    })
  }

  handleSubmit(){
    
    var questionModel = {name: this.state.question, value: this.state.answer};
    var doneModel = {name:"hydrationIntakeDone", value:true};

    var updateModels = [questionModel, doneModel];

    this.props.onUpdateMany(updateModels, this.state.identified);
  }


  render(){

    return(

      <div style={{textAlign: 'center', marginTop: '3em'}}>
        <h3>Oral intake for shift</h3>     

        <p>
              <input 
              placeholder="intake in ml"
              type="number"
              className="assessment-input"
              value={this.state.date}
              onChange={(e)=>this.setState({answer: e.target.value})}
              />
            </p>
        <p style={{marginTop: '4em'}}>
          { !isNaN(this.state.answer) && this.state.answer!== "" ? <button
         className={unselected}
         onClick={()=>this.handleSubmit()}
        >Next</button> : <></> }</p>
      </div>
  );
  }

}

export default HydrationIntake
