<commit_before>import React from 'react'
import ActionButton from './../GroupIconButton/FavorDeleteButton'
import Paper from 'material-ui/Paper'
import Comments from './../Comments'

class BookCard extends React.Component {

  constructor(props) {
    super(props)
    this.state = {
      favorite: false
    }
  }

  handleDeleteBook = () => {
    this.props.deleteBook();
  }

  groupAuthors = (authors) => {
    let result = ''
    if (Array.isArray(authors)) {
      authors.length > 1 ? authors.forEach(a => { result = a.name + ', ' }) : result = authors[0].name
      return result
    }
    return authors[0].name
  }



  render() {
    console.log(this.props.book)
    const { book, edit, added, liked } = this.props;<commit_msg>refactoring display authors in book<commit_after>import React from 'react'
import ActionButton from './../GroupIconButton/FavorDeleteButton'
import Paper from 'material-ui/Paper'
import Comments from './../Comments'

class BookCard extends React.Component {

  constructor(props) {
    super(props)
    this.state = {
      favorite: false
    }
  }

  handleDeleteBook = () => {
    this.props.deleteBook();
  }

  groupAuthors = (authors) => {
    let result = ''
    if (Array.isArray(authors)) {
      result = authors.map((a, i) => i === 0 ? a.name : ', ' + a.name)
    }
    return result
  }



  render() {
    console.log(this.props.book)
    const { book, edit, added, liked } = this.props;
{'fraction_non_alphanumeric': 0.14454482279360667, 'fraction_numerical': 0.002779708130646282, 'mean_word_length': 2.8502673796791442, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '3208704', 'n_tokens_mistral': 463, 'n_tokens_neox': 441, 'n_words': 105}