<commit_before>import React, { Component, PropTypes } from 'react';
import { Link } from 'react-router';
import { formatDate, formatBytes } from '../../../utils/helpers';
import DeleteIcon from '../../../components/DeleteIcon';
import Page from '../../../containers/Page';
import Table from '../../../components/Table';
import Button from '../../../components/Button';
import TitleBar from '../../../components/TitleBar';
import { deleteAsset, indexAssets } from '../../../actions/assetActions';

export default class Assets extends Component {
  static propTypes = {
    assets: PropTypes.object,
    dispatch: PropTypes.func,
  }

  static defaultProps = {
    assets: null,
    dispatch: null,
  }

  indexAssets() {
    this.props.dispatch(indexAssets());
  }

  render() {
    const { assets, dispatch } = this.props;

    const reduced = assets.assets.map(props => ({
      key: props._id,
      image: {
        sortBy: false,
        component: <a href={`/public/assets/${props.filename}`} rel="noopener noreferrer" target="_blank"><img src={`/public/assets/${props.filename}`} alt={props.filename} /></a>,
      },
      title: {
        value: props.title,
        component: <a href={`/public/assets/${props.filename}`} rel="noopener noreferrer" target="_blank">{props.title}</a>,
      },
      filename: props.filename,
      size: formatBytes(props.size, 0),<commit_msg>:art: :link: Update links in assets table<commit_after>import React, { Component, PropTypes } from 'react';
import { Link } from 'react-router';
import { formatDate, formatBytes } from '../../../utils/helpers';
import DeleteIcon from '../../../components/DeleteIcon';
import Page from '../../../containers/Page';
import Table from '../../../components/Table';
import Button from '../../../components/Button';
import TitleBar from '../../../components/TitleBar';
import { deleteAsset, indexAssets } from '../../../actions/assetActions';

export default class Assets extends Component {
  static propTypes = {
    assets: PropTypes.object,
    dispatch: PropTypes.func,
  }

  static defaultProps = {
    assets: null,
    dispatch: null,
  }

  indexAssets() {
    this.props.dispatch(indexAssets());
  }

  render() {
    const { assets, dispatch } = this.props;

    const reduced = assets.assets.map(props => ({
      key: props._id,
      image: {
        sortBy: false,
        component: <Link to={`/admin/settings/assets/${props._id}`}><img src={`/public/assets/${props.filename}`} alt={props.filename} /></Link>,
      },
      title: {
        value: props.title,
        component: <Link to={`/admin/settings/assets/${props._id}`}>{props.title}</Link>,
      },
      filename: props.filename,
      size: formatBytes(props.size, 0),
{'fraction_non_alphanumeric': 0.18488628026412326, 'fraction_numerical': 0.0007336757153338225, 'mean_word_length': 2.957910014513788, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, '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': '6416064', 'n_tokens_mistral': 775, 'n_tokens_neox': 794, 'n_words': 191}