<commit_before>import * as React from 'react';
import * as _ from 'lodash';
import * as fx from 'money';
import * as moment from 'moment';
import FormPure from './FormPure';
import FormWrap from './FormWrap';
import Contact from '../Contact';
import Raido from '../Raido';
import i from '../i18n';

export default class FormVG extends React.Component<any, any> {
  constructor(props) {
    super(props);
    const { start, end } = props;
    this.state = {
      startDate: start && moment.unix(start).toDate(),
      endDate: end && moment.unix(end).toDate(),
      equipment: 1,
    };
  }

  getTitle = () => _.get(this.props.offer, 'title', '')
  getPrice = () => _.get(this.props.offer, 'price', 0)
  getRange = () => (this.state.startDate && this.state.endDate) ? (Math.abs(moment(this.state.endDate).diff(moment(this.state.startDate), 'days')) + 1) : 0;
  getTotal = () => this.getPrice() * this.getRange();
  endDateChange = (ev, endDate) => this.setState({ endDate });
  startDateChange = (ev, startDate) => this.setState({ startDate });
  equipmentChange = (ev, index, equipment) => this.setState({ equipment });

  getMessage = () => `RIDE REQUEST - ${this.getTitle()}
Offer: ${location.hostname}/offer/${this.props.offer.id},
Start date: ${this.state.startDate},
End date: ${this.state.endDate},
Equipment: ${this.state.equipment},
Price: ${fx(this.getPrice()).to(i('USD')).toFixed(2)} ${i('USD')},
Total: ${fx(this.getTotal()).to(i('USD')).toFixed(2)} ${i('USD')},
Currency: ${i('USD')}`;

  render() {
    const title = this.getTitle();
    const price = this.getPrice();
    const total = this.getTotal();

    const formData = {
      ...this.state,<commit_msg>Fixed arrow funcs<commit_after>import * as React from 'react';
import * as _ from 'lodash';
import * as fx from 'money';
import * as moment from 'moment';
import FormPure from './FormPure';
import FormWrap from './FormWrap';
import Contact from '../Contact';
import Raido from '../Raido';
import i from '../i18n';

export default class FormVG extends React.Component<any, any> {
  constructor(props) {
    super(props);
    const { start, end } = props;
    this.state = {
      startDate: start && moment.unix(start).toDate(),
      endDate: end && moment.unix(end).toDate(),
      equipment: 1,
    };
  }

  getTitle = offer => _.get(offer, 'title', '')
  getPrice = offer => _.get(offer, 'price', 0)
  getRange = () => (this.state.startDate && this.state.endDate) ? (Math.abs(moment(this.state.endDate).diff(moment(this.state.startDate), 'days')) + 1) : 0;
  getTotal = () => this.getPrice(this.props.offer) * this.getRange();
  endDateChange = (ev, endDate) => this.setState({ endDate });
  startDateChange = (ev, startDate) => this.setState({ startDate });
  equipmentChange = (ev, index, equipment) => this.setState({ equipment });

  getMessage = () => `RIDE REQUEST - ${this.getTitle(this.props.offer)}
Offer: ${location.hostname}/offer/${this.props.offer.id},
Start date: ${this.state.startDate},
End date: ${this.state.endDate},
Equipment: ${this.state.equipment},
Price: ${fx(this.getPrice(this.props.offer)).to(i('USD')).toFixed(2)} ${i('USD')},
Total: ${fx(this.getTotal()).to(i('USD')).toFixed(2)} ${i('USD')},
Currency: ${i('USD')}`;

  render() {
    const title = this.getTitle(this.props.offer);
    const price = this.getPrice(this.props.offer);
    const total = this.getTotal();

    const formData = {
      ...this.state,
{'fraction_non_alphanumeric': 0.2016364699006429, 'fraction_numerical': 0.004675628287551139, 'mean_word_length': 4.101341281669151, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '2191812', 'n_tokens_mistral': 1177, 'n_tokens_neox': 1146, 'n_words': 261}