<commit_before>import React, { Component } from 'react';
import MrkdwnText from './MrkdwnText';

import './Files.less';

export default class extends Component {
  render() {
    const {files} = this.props;
    return (
      <div className="slack-message-files">
        { files.map((file) => (
          <div key={file.id} className="slack-message-file">
            {file.mimetype.startsWith('image/') ? (
              <div className="file-thumb">
                <div className="file-title">{file.title} ({file.original_w}x{file.original_h}, {(file.size / 1024).toFixed(2)}KB, {file.pretty_type})</div>
                <a href={file.url_private_download} target="_blank" rel="noopener noreferrer">
                  <img src={file.url_private_download}/>
                </a>
              </div>
            ) : (
              <a href={file.url_private_download} target="_blank" rel="noopener noreferrer">
                <div className="file-no-thumb">
                  <div className="file-no-thumb-title">{file.title}</div>
                  <div className="file-no-thumb-description">{(file.size / 1024).toFixed(2)}KB, {file.pretty_type}</div>
                </div>
              </a>
            )}
          </div>
        )) }
      </div>
    );<commit_msg>Handle the case where mimetype doesn't exist in the file property<commit_after>import React, { Component } from 'react';
import MrkdwnText from './MrkdwnText';

import './Files.less';

export default class extends Component {
  render() {
    const {files} = this.props;
    return (
      <div className="slack-message-files">
        { files.map((file) => (
          <div key={file.id} className="slack-message-file">
            {file.mimetype && file.mimetype.startsWith('image/') ? (
              <div className="file-thumb">
                <div className="file-title">{file.title} ({file.original_w}x{file.original_h}, {(file.size / 1024).toFixed(2)}KB, {file.pretty_type})</div>
                <a href={file.url_private_download} target="_blank" rel="noopener noreferrer">
                  <img src={file.url_private_download}/>
                </a>
              </div>
            ) : (
              <a href={file.url_private_download} target="_blank" rel="noopener noreferrer">
                <div className="file-no-thumb">
                  <div className="file-no-thumb-title">{file.title}</div>
                  <div className="file-no-thumb-description">{(file.size / 1024).toFixed(2)}KB, {file.pretty_type}</div>
                </div>
              </a>
            )}
          </div>
        )) }
      </div>
    );
{'fraction_non_alphanumeric': 0.16201757737867786, 'fraction_numerical': 0.007642338555598013, 'mean_word_length': 2.058411214953271, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4613755', 'n_tokens_mistral': 823, 'n_tokens_neox': 774, 'n_words': 135}