<commit_before>import React, { PureComponent } from 'react';
import { Components, registerComponent } from 'meteor/vulcan:core';
import { Posts, Comments } from "meteor/example-forum";
import Users from 'meteor/vulcan:users';
import moment from 'moment';
import { Link } from 'react-router'

const DateDisplay = ({column, document}) => {
  return <div>{document[column.name] && moment(document[column.name]).fromNow()}</div>
}

const PostDisplay = ({column, document}) => {
  const post = document.post || document
  return <Link to={Posts.getPageUrl(post) + "#" + document._id }>{ post.title }</Link>
}

const UserDisplay = ({column, document}) => {
  const user = document.deletedByUser || document.user || document
  return <div>
    <Components.UsersName user={user} />
  </div>
}

const BannedUsersDisplay = ({column, document}) => {
  const bannedUsers = document[column.name]
  return <div>
    { bannedUsers.map((userId) => <div key={userId}>
      <Components.UsersNameWrapper documentId={userId} />
      </div>)}
  </div>
}


const deletedCommentColumns = [
  {
    name: 'user',
    component: UserDisplay,
  },
  {
    name: 'post',
    component: PostDisplay,
  },
  {
    name: 'deletedByUser',
    component: UserDisplay,
  },
  {
    name: 'deletedDate',
    label: 'Deleted Date',
    component: DateDisplay,
  },
  {
    name:'deletedPublic',
    label:'Deleted Public'
  },
  {
    name:'deletedReason',
    label:'Reason'
  },
]

const usersBannedFromPostsColumns = [
  {
    name: 'user',
    component: UserDisplay,
  },
  {<commit_msg>Moderation Log<commit_after>import React, { PureComponent } from 'react';
import { Components, registerComponent } from 'meteor/vulcan:core';
import { Posts, Comments } from "meteor/example-forum";
import Users from 'meteor/vulcan:users';
import moment from 'moment';
import { Link } from 'react-router'

const DateDisplay = ({column, document}) => {
  return <div>{document[column.name] && moment(document[column.name]).fromNow()}</div>
}

const PostDisplay = ({column, document}) => {
  const post = document.post || document
  return <Link to={Posts.getPageUrl(post) + "#" + document._id }>{ post.title }</Link>
}

const UserDisplay = ({column, document}) => {
  const user = document.user || document.user || document
  return <div>
    <Components.UsersName user={user} />
  </div>
}

const DeletedByUserDisplay = ({column, document}) => {
  const user = document.deletedByUser || document.user || document
  return <div>
    <Components.UsersName user={user} />
  </div>
}


const BannedUsersDisplay = ({column, document}) => {
  const bannedUsers = document[column.name]
  return <div>
    { bannedUsers.map((userId) => <div key={userId}>
      <Components.UsersNameWrapper documentId={userId} />
      </div>)}
  </div>
}


const deletedCommentColumns = [
  {
    name: 'user',
    component: UserDisplay,
  },
  {
    name: 'post',
    component: PostDisplay,
  },
  {
    name: 'deletedByUser',
    component: DeletedByUserDisplay,
  },
  {
    name: 'deletedDate',
    label: 'Deleted Date',
    component: DateDisplay,
  },
  {
    name:'deletedPublic',
    label:'Deleted Public'
  },
  {
    name:'deletedReason',
    label:'Reason'
  },
]

const usersBannedFromPostsColumns = [
  {
    name: 'user',
    component: UserDisplay,
  },
  {
{'fraction_non_alphanumeric': 0.159214501510574, 'fraction_numerical': 0.0, 'mean_word_length': 3.750358680057389, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 41, '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': '2404125', 'n_tokens_mistral': 1061, 'n_tokens_neox': 1060, 'n_words': 235}