<commit_before>// eslint-disable-next-line no-unused-vars
import React from 'react'
import { View, Text } from '../../reactPdf.js'

const fontSize = 8
const initialFontSize = fontSize * 0.75

function color(campCollaboration) {
  const h = parseInt(campCollaboration.user()?.id || campCollaboration.id, 16) % 360
  return `hsl(${h}, 100%, 30%)`
}

function initials(campCollaboration) {
  const displayName =
    campCollaboration.user()?.displayName ||
    campCollaboration.inviteEmail.split('@', 2).shift()
  let items = displayName.split(' ', 2)
  if (items.length === 1) {
    items = items.shift().split(/[,._-]/, 2)
  }
  if (items.length === 1) {
    return displayName.substr(0, 2).toUpperCase()
  } else {
    return items[0].substr(0, 1) + items[1].substr(0, 1).toUpperCase()
  }
}

const avatarsStyles = {
  flexDirection: 'row',
  alignItems: 'flex-end',
}

const avatarStyles = {
  borderRadius: '50%',
  width: initialFontSize * 2 + 'pt',
  height: initialFontSize * 2 + 'pt',
  flexDirection: 'column',
  justifyContent: 'center',
}

const initialsStyles = {
  fontSize: initialFontSize + 'pt',
  textAlign: 'center',
  color: 'white',
}
<commit_msg>Also fix the invite-collaboration bug in react print<commit_after>// eslint-disable-next-line no-unused-vars
import React from 'react'
import { View, Text } from '../../reactPdf.js'

const fontSize = 8
const initialFontSize = fontSize * 0.75

function displayNameFor(campCollaboration) {
  return campCollaboration.inviteEmail
    ? campCollaboration.inviteEmail.split('@', 2).shift()
    : campCollaboration.user().displayName
}

function color(campCollaboration) {
  const h =
    parseInt(
      campCollaboration.inviteEmail ? campCollaboration.id : campCollaboration.user().id,
      16
    ) % 360
  return `hsl(${h}, 100%, 30%)`
}

function initials(campCollaboration) {
  const displayName = displayNameFor(campCollaboration)

  let items = displayName.split(' ', 2)
  if (items.length === 1) {
    items = items.shift().split(/[,._-]/, 2)
  }
  if (items.length === 1) {
    return displayName.substr(0, 2).toUpperCase()
  } else {
    return items[0].substr(0, 1) + items[1].substr(0, 1).toUpperCase()
  }
}

const avatarsStyles = {
  flexDirection: 'row',
  alignItems: 'flex-end',
}

const avatarStyles = {
  borderRadius: '50%',
  width: initialFontSize * 2 + 'pt',
  height: initialFontSize * 2 + 'pt',
  flexDirection: 'column',
  justifyContent: 'center',
}

const initialsStyles = {
  fontSize: initialFontSize + 'pt',
  textAlign: 'center',
  color: 'white',
}

{'fraction_non_alphanumeric': 0.15834970530451867, 'fraction_numerical': 0.0243614931237721, 'mean_word_length': 3.962962962962963, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4335658', 'n_tokens_mistral': 926, 'n_tokens_neox': 886, 'n_words': 196}