<commit_before>// @flow
import * as React from 'react'
import * as RPCChatTypes from '../../../../../constants/types/rpc-chat-gen'
import * as Styles from '../../../../../styles'
import {Box2} from '../../../../../common-adapters/index'
import UnfurlGeneric from '../generic/container'

export type UnfurlListItem = {
  unfurl: RPCChatTypes.UnfurlDisplay,
  url: string,
  onClose?: () => void,
}

export type ListProps = {
  unfurls: Array<UnfurlListItem>,
}

export type UnfurlProps = {
  unfurl: RPCChatTypes.UnfurlDisplay,
  onClose?: () => void,
}

class Unfurl extends React.PureComponent<UnfurlProps> {
  render() {
    switch (this.props.unfurl.unfurlType) {
      case RPCChatTypes.unfurlUnfurlType.generic:
        return this.props.unfurl.generic ? (
          <UnfurlGeneric unfurl={this.props.unfurl.generic} onClose={this.props.onClose} />
        ) : null
      default:
        return null
    }
  }
}

class UnfurlList extends React.PureComponent<ListProps> {
  render() {
    return (
      <Box2 direction="vertical" gap="tiny" style={styles.container}>
        {this.props.unfurls.map(u => (
          <Unfurl key={u.url} unfurl={u.unfurl} onClose={u.onClose} />
        ))}
      </Box2>
    )
  }
}

const styles = Styles.styleSheetCreate({
  container: Styles.platformStyles({
    common: {
      flex: 1,
      marginTop: Styles.globalMargins.xtiny,
      marginBottom: Styles.globalMargins.xtiny,
    },
    // See ReactionRow for where this calculation comes from
    isElectron: {
      marginLeft: 32 + Styles.globalMargins.tiny + Styles.globalMargins.small,
      marginRight: Styles.globalMargins.medium,
    },
    isMobile: {
      marginLeft: 32 + Styles.globalMargins.tiny + Styles.globalMargins.tiny,
      width: '100%',
    },<commit_msg>fix mobile unfurl placement<commit_after>// @flow
import * as React from 'react'
import * as RPCChatTypes from '../../../../../constants/types/rpc-chat-gen'
import * as Styles from '../../../../../styles'
import {Box2} from '../../../../../common-adapters/index'
import UnfurlGeneric from '../generic/container'

export type UnfurlListItem = {
  unfurl: RPCChatTypes.UnfurlDisplay,
  url: string,
  onClose?: () => void,
}

export type ListProps = {
  unfurls: Array<UnfurlListItem>,
}

export type UnfurlProps = {
  unfurl: RPCChatTypes.UnfurlDisplay,
  onClose?: () => void,
}

class Unfurl extends React.PureComponent<UnfurlProps> {
  render() {
    switch (this.props.unfurl.unfurlType) {
      case RPCChatTypes.unfurlUnfurlType.generic:
        return this.props.unfurl.generic ? (
          <UnfurlGeneric unfurl={this.props.unfurl.generic} onClose={this.props.onClose} />
        ) : null
      default:
        return null
    }
  }
}

class UnfurlList extends React.PureComponent<ListProps> {
  render() {
    return (
      <Box2 direction="vertical" gap="tiny" style={styles.container}>
        {this.props.unfurls.map(u => (
          <Unfurl key={u.url} unfurl={u.unfurl} onClose={u.onClose} />
        ))}
      </Box2>
    )
  }
}

const styles = Styles.styleSheetCreate({
  container: Styles.platformStyles({
    common: {
      flex: 1,
      marginTop: Styles.globalMargins.xtiny,
      marginBottom: Styles.globalMargins.xtiny,
    },
    // See ReactionRow for where this calculation comes from
    isElectron: {
      marginLeft: 32 + Styles.globalMargins.tiny + Styles.globalMargins.small,
      marginRight: Styles.globalMargins.medium,
    },
    isMobile: {
      marginLeft: 32 + Styles.globalMargins.tiny + Styles.globalMargins.tiny,
      width: '100%',
      alignSelf: 'flex-start',
    },
{'fraction_non_alphanumeric': 0.14659248956884563, 'fraction_numerical': 0.00611961057023644, 'mean_word_length': 2.83778014941302, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 23, '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': '3138427', 'n_tokens_mistral': 1229, 'n_tokens_neox': 1210, 'n_words': 233}