<commit_before>import React from "react"
import { createFragmentContainer, graphql } from "react-relay"

import { StyleSheet, Text, TextStyle, View, ViewProperties, ViewStyle } from "react-native"

import SerifText from "lib/Components/Text/Serif"
import colors from "lib/data/colors"
import fonts from "lib/data/fonts"

import { Metadata_show } from "__generated__/Metadata_show.graphql"

interface Props extends ViewProperties {
  show: Metadata_show
}

class Metadata extends React.Component<Props> {
  render() {
    const partnerName = this.props.show.partner && this.props.show.partner.name
    return (
      <View style={styles.container}>
        {!!partnerName && <Text style={styles.sansSerifText}>{partnerName.toUpperCase()}</Text>}
        <Text style={styles.sansSerifText}>{this.showTypeString()}</Text>
        <SerifText style={styles.serifText}>{this.props.show.name}</SerifText>
        {this.dateAndLocationString()}
        {this.statusText()}
      </View>
    )
  }

  showTypeString() {
    const message = this.props.show.kind.toUpperCase() + (this.props.show.kind === "fair" ? " BOOTH" : " SHOW")
    return message
  }

  dateAndLocationString() {
    const exhibition_period = this.props.show.exhibition_period
    const city = this.props.show.location && this.props.show.location.city

    if (city || exhibition_period) {
      const text = city ? city.trim() + ", " + exhibition_period : exhibition_period
      return <SerifText style={[styles.serifText, { color: "grey" }]}>{text}</SerifText>
    }
    return null
  }

  statusText() {
    if (this.props.show.status_update) {
      const textColor = this.props.show.status === "upcoming" ? "green-regular" : "red-regular"
      return <SerifText style={{ color: colors[textColor] }}>{this.props.show.status_update}</SerifText><commit_msg>Null checks for optional show.kind metadata<commit_after>import React from "react"
import { createFragmentContainer, graphql } from "react-relay"

import { StyleSheet, Text, TextStyle, View, ViewProperties, ViewStyle } from "react-native"

import SerifText from "lib/Components/Text/Serif"
import colors from "lib/data/colors"
import fonts from "lib/data/fonts"

import { Metadata_show } from "__generated__/Metadata_show.graphql"

interface Props extends ViewProperties {
  show: Metadata_show
}

class Metadata extends React.Component<Props> {
  render() {
    const partnerName = this.props.show.partner && this.props.show.partner.name
    return (
      <View style={styles.container}>
        {!!partnerName && <Text style={styles.sansSerifText}>{partnerName.toUpperCase()}</Text>}
        {!!this.showTypeString() && <Text style={styles.sansSerifText}>{this.showTypeString()}</Text>}
        <SerifText style={styles.serifText}>{this.props.show.name}</SerifText>
        {this.dateAndLocationString()}
        {this.statusText()}
      </View>
    )
  }

  showTypeString() {
    if (this.props.show.kind) {
      const message = this.props.show.kind.toUpperCase() + (this.props.show.kind === "fair" ? " BOOTH" : " SHOW")
      return message
    }
    return null
  }

  dateAndLocationString() {
    const exhibition_period = this.props.show.exhibition_period
    const city = this.props.show.location && this.props.show.location.city

    if (city || exhibition_period) {
      const text = city ? city.trim() + ", " + exhibition_period : exhibition_period
      return <SerifText style={[styles.serifText, { color: "grey" }]}>{text}</SerifText>
    }
    return null
  }

  statusText() {
    if (this.props.show.status_update) {
      const textColor = this.props.show.status === "upcoming" ? "green-regular" : "red-regular"
      return <SerifText style={{ color: colors[textColor] }}>{this.props.show.status_update}</SerifText>
{'fraction_non_alphanumeric': 0.14057932500664364, 'fraction_numerical': 0.0, 'mean_word_length': 3.869340232858991, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, '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': '5006203', 'n_tokens_mistral': 1189, 'n_tokens_neox': 1168, 'n_words': 233}