<commit_before>import React, { Component } from 'react';
import { Grid, Input, Button, Segment } from 'semantic-ui-react'
import RecipientInfo from './RecipientInfo'
import DatePicker from 'react-datepicker';
import moment from 'moment';

import 'react-datepicker/dist/react-datepicker.css';

export default class InvoiceDetails extends Component {
  constructor() {
    super()
    this.state = {date: moment()}
  }

  handleAmountChange = (e) => this.props.setAmount(e.target.value)
  handleDateChange = (date) => {
    this.setState({date: date})
    this.props.setDate(date)
  }

  render() {
    return <Segment>
      <Grid columns={2}>
        <Grid.Column width={12}>
          <Segment>
            <Input label='Invoice amount' placeholder='Amount' onChange={this.handleAmountChange}/>
            <DatePicker selected={this.state.date} onChange={this.handleDateChange} />
          </Segment>
          <p>Invoice file: {this.props.invoiceFilename}</p>
        </Grid.Column>
        <Grid.Column width={4}>
          <RecipientInfo setRecipient={this.props.setRecipient}/>
        </Grid.Column>
      </Grid>
    </Segment>
  }
}<commit_msg>Set default values for date and amount<commit_after>import React, { Component } from 'react';
import { Grid, Input, Button, Segment } from 'semantic-ui-react'
import RecipientInfo from './RecipientInfo'
import DatePicker from 'react-datepicker';
import moment from 'moment';

import 'react-datepicker/dist/react-datepicker.css';

export default class InvoiceDetails extends Component {
  constructor() {
    super()
    this.state = {}
  }

  componentDidMount() {
    this.handleDateChange(moment())
    this.props.setAmount(0)
  }

  handleAmountChange = (e) => this.props.setAmount(e.target.value)
  handleDateChange = (date) => {
    this.setState({date: date})
    this.props.setDate(date)
  }

  render() {
    return <Segment>
      <Grid columns={2}>
        <Grid.Column width={12}>
          <Segment>
            <Input label='Invoice amount' placeholder='Amount' onChange={this.handleAmountChange}/>
            <DatePicker selected={this.state.date} onChange={this.handleDateChange} />
          </Segment>
          <p>Invoice file: {this.props.invoiceFilename}</p>
        </Grid.Column>
        <Grid.Column width={4}>
          <RecipientInfo setRecipient={this.props.setRecipient}/>
        </Grid.Column>
      </Grid>
    </Segment>
  }
}
{'fraction_non_alphanumeric': 0.14096185737976782, 'fraction_numerical': 0.0037313432835820895, 'mean_word_length': 3.124786324786325, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 37, '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': '6599126', 'n_tokens_mistral': 731, 'n_tokens_neox': 713, 'n_words': 153}