<commit_before>import React, { Component } from 'react'
import { connect } from 'react-redux'
import { Button } from 'react-bootstrap'
import { VelocityTransitionGroup } from 'velocity-react'
import moment from 'moment'

import { calculateFares, calculatePhysicalActivity, getTimeZoneOffset } from '../../util/itinerary'
import { mergeMessages } from '../../util/messages'
import { formatTime, getTimeFormat, getLongDateFormat } from '../../util/time'

class TripDetails extends Component {
  static defaultProps = {
    messages: {
      at: 'at',
      caloriesBurned: 'Calories Burned',
      // FIXME: Add templated string description.
      // caloriesBurnedDescription: 'Calories Burned',
      depart: 'Depart',
      title: 'Trip Details',
      fare: 'Fare',
      transitFare: 'Transit Fare'
    }
  }

  render () {
    const { itinerary, timeFormat, longDateFormat } = this.props
    const messages = mergeMessages(TripDetails.defaultProps, this.props)
    const date = moment(itinerary.startTime)

    // process the transit fare
    const { centsToString, dollarsToString, maxTNCFare, minTNCFare, transitFare } = calculateFares(itinerary)
    let companies
    itinerary.legs.forEach(leg => {
      if (leg.tncData) {
        companies = leg.tncData.company<commit_msg>refactor(messages): surface null description msg for TripDetails<commit_after>import React, { Component } from 'react'
import { connect } from 'react-redux'
import { Button } from 'react-bootstrap'
import { VelocityTransitionGroup } from 'velocity-react'
import moment from 'moment'

import { calculateFares, calculatePhysicalActivity, getTimeZoneOffset } from '../../util/itinerary'
import { mergeMessages } from '../../util/messages'
import { formatTime, getTimeFormat, getLongDateFormat } from '../../util/time'

class TripDetails extends Component {
  static defaultProps = {
    // Note: messages with default null values included here for visibility.
    // Overriding with a truthy string value will cause the expandable help
    // message to appear in trip details.
    messages: {
      at: 'at',
      caloriesBurned: 'Calories Burned',
      // FIXME: Add templated string description.
      caloriesBurnedDescription: null,
      depart: 'Depart',
      departDescription: null,
      title: 'Trip Details',
      fare: 'Fare',
      transitFare: 'Transit Fare',
      transitFareDescription: null
    }
  }

  render () {
    const { itinerary, timeFormat, longDateFormat } = this.props
    const messages = mergeMessages(TripDetails.defaultProps, this.props)
    const date = moment(itinerary.startTime)

    // process the transit fare
    const { centsToString, dollarsToString, maxTNCFare, minTNCFare, transitFare } = calculateFares(itinerary)
    let companies
    itinerary.legs.forEach(leg => {
      if (leg.tncData) {
        companies = leg.tncData.company
{'fraction_non_alphanumeric': 0.10548375829549424, 'fraction_numerical': 0.0, 'mean_word_length': 3.5244865718799367, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2636561', 'n_tokens_mistral': 812, 'n_tokens_neox': 812, 'n_words': 231}