<commit_before>import React from 'react';
import { Components, registerComponent } from '../../lib/vulcan-lib';
import { Votes } from '../../lib/collections/votes';
import { useMulti } from '../../lib/crud/withMulti';
import { useCurrentUser } from '../common/withUser';
import { TagRels } from '../../lib/collections/tagRels/collection';
import { Posts } from '../../lib/collections/posts';
import { Link } from '../../lib/reactRouterWrapper';
import { useVote } from '../votes/withVote';

const styles = theme => ({
  voteRow: {
  },
  headerCell: {
    fontWeight: "bold"
  },
  votingCell: {
    textAlign: "center",
    fontSize: '1.4rem'
  },
  voteButtons: {
    width: 50
  },
  tagCell: {
    width: 200,
    textAlign: "right"
  },
  score: {
    fontSize: '1.2rem',
    position: "relative",
    bottom: -1,
    margin: 5
  }
})

const TagVoteActivity = ({classes}:{
  classes: ClassesType,
}) => {
  const { SingleColumnSection, FormatDate, Error404, VoteButton, FooterTag, LoadMore } = Components
  const { results: votes, loadMoreProps } = useMulti({
    terms: {view:"tagVotes"},
    collection: Votes,
    fragmentName: 'TagRelVotes',
    limit: 200,
    ssr: true
  })
  const castVote = useVote()

  const currentUser = useCurrentUser();

  if (!currentUser?.isAdmin) { return <Error404/> }

  return <SingleColumnSection>
    <table>
      <tbody>
        <tr className={classes.headerRow}>
          <td className={classes.headerCell}> User </td>
          <td className={classes.headerCell}> Tag </td>
          <td className={classes.headerCell}> Pow </td>
          <td className={classes.headerCell}> Post Title </td>
          <td className={classes.headerCell}> When </td>
          <td className={classes.headerCell}> Vote </td>
        </tr>
        {votes?.map(vote=><tr key={vote._id} className={classes.voteRow}>
            <td>{vote.userId?.slice(7,10)}</td>
            <td className={classes.tagCell}><FooterTag tag={vote.tagRel?.tag} tagRel={vote.tagRel} hideScore /></td>
            <td> <Link to={Posts.getPageUrl(vote.tagRel?.post)}> {vote.tagRel?.post?.title} </Link> </td>
            <td>{vote.power} {vote.isUnvote && <span title="Unvote">(unv.)</span>}</td><commit_msg>Fix order of column headings<commit_after>import React from 'react';
import { Components, registerComponent } from '../../lib/vulcan-lib';
import { Votes } from '../../lib/collections/votes';
import { useMulti } from '../../lib/crud/withMulti';
import { useCurrentUser } from '../common/withUser';
import { TagRels } from '../../lib/collections/tagRels/collection';
import { Posts } from '../../lib/collections/posts';
import { Link } from '../../lib/reactRouterWrapper';
import { useVote } from '../votes/withVote';

const styles = theme => ({
  voteRow: {
  },
  headerCell: {
    fontWeight: "bold"
  },
  votingCell: {
    textAlign: "center",
    fontSize: '1.4rem'
  },
  voteButtons: {
    width: 50
  },
  tagCell: {
    width: 200,
    textAlign: "right"
  },
  score: {
    fontSize: '1.2rem',
    position: "relative",
    bottom: -1,
    margin: 5
  }
})

const TagVoteActivity = ({classes}:{
  classes: ClassesType,
}) => {
  const { SingleColumnSection, FormatDate, Error404, VoteButton, FooterTag, LoadMore } = Components
  const { results: votes, loadMoreProps } = useMulti({
    terms: {view:"tagVotes"},
    collection: Votes,
    fragmentName: 'TagRelVotes',
    limit: 200,
    ssr: true
  })
  const castVote = useVote()

  const currentUser = useCurrentUser();

  if (!currentUser?.isAdmin) { return <Error404/> }

  return <SingleColumnSection>
    <table>
      <tbody>
        <tr className={classes.headerRow}>
          <td className={classes.headerCell}> User </td>
          <td className={classes.headerCell}> Tag </td>
          <td className={classes.headerCell}> Post Title </td>
          <td className={classes.headerCell}> Pow </td>
          <td className={classes.headerCell}> When </td>
          <td className={classes.headerCell}> Vote </td>
        </tr>
        {votes?.map(vote=><tr key={vote._id} className={classes.voteRow}>
            <td>{vote.userId?.slice(7,10)}</td>
            <td className={classes.tagCell}><FooterTag tag={vote.tagRel?.tag} tagRel={vote.tagRel} hideScore /></td>
            <td> <Link to={Posts.getPageUrl(vote.tagRel?.post)}> {vote.tagRel?.post?.title} </Link> </td>
            <td>{vote.power} {vote.isUnvote && <span title="Unvote">(unv.)</span>}</td>
{'fraction_non_alphanumeric': 0.17825793382849425, 'fraction_numerical': 0.010353364843574162, 'mean_word_length': 3.0217194570135746, 'pattern_counts': {'":': 0, '<': 67, '<?xml version=': 0, '>': 73, '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': '5393027', 'n_tokens_mistral': 1459, 'n_tokens_neox': 1434, 'n_words': 315}