<commit_before>import * as React from 'react'
import { DiscModel, SakuraModel, SakuraOfDiscsModel } from './reducer'
import { ViewportProps, withViewport } from '../../hoc/Viewport'
import { compareFactory } from '../../utils/compare'
import { Column, Table } from '../../lib/table'
import { formatNumber } from '../../utils/format'
import { Command } from '../../lib/command'
import { Timer } from '../../lib/timer'
import * as classNames from 'classnames'

interface Props {
  detail: SakuraOfDiscsModel
  isPcMode: boolean
  toViewDisc: (t: DiscModel) => void
  toViewRank: (t: DiscModel) => void
}

function SakuraDiscs(props: Props & ViewportProps) {

  function getColumns(): Column<DiscModel>[] {
    return [
      {
        key: 'rank',
        title: '日亚排名',
        format: (t) => <Command onClick={toViewRank(t)}>{formatRank(t)}</Command>,
        tdClass: (t) => rankTdClass(t),
        compare: compareFactory<DiscModel, number | undefined>({
          apply: model => model.thisRank,
          check: value => value === undefined,
          compare: (a, b) => a! - b!
        })
      },
      {
        key: 'todayPt',
        title: '日增',
        format: (t) => `${(t.todayPt || '----')} pt`,
        compare: compareFactory<DiscModel, number | undefined>({
          apply: model => model.todayPt,
          check: value => value === undefined,
          compare: (a, b) => b! - a!
        }),
      },
      {
        key: 'totalPt',
        title: '累积',
        format: (t) => `${(t.totalPt || '----')} pt`,
        compare: compareFactory<DiscModel, number | undefined>({
          apply: model => model.totalPt,
          check: value => value === undefined,<commit_msg>fix(sakura-discs): Fix Sort Rank Zero<commit_after>import * as React from 'react'
import { DiscModel, SakuraModel, SakuraOfDiscsModel } from './reducer'
import { ViewportProps, withViewport } from '../../hoc/Viewport'
import { compareFactory } from '../../utils/compare'
import { Column, Table } from '../../lib/table'
import { formatNumber } from '../../utils/format'
import { Command } from '../../lib/command'
import { Timer } from '../../lib/timer'
import * as classNames from 'classnames'

interface Props {
  detail: SakuraOfDiscsModel
  isPcMode: boolean
  toViewDisc: (t: DiscModel) => void
  toViewRank: (t: DiscModel) => void
}

function SakuraDiscs(props: Props & ViewportProps) {

  function getColumns(): Column<DiscModel>[] {
    return [
      {
        key: 'rank',
        title: '日亚排名',
        format: (t) => <Command onClick={toViewRank(t)}>{formatRank(t)}</Command>,
        tdClass: (t) => rankTdClass(t),
        compare: compareFactory<DiscModel, number | undefined>({
          apply: model => model.thisRank,
          check: value => value === undefined || value === 0,
          compare: (a, b) => a! - b!
        })
      },
      {
        key: 'todayPt',
        title: '日增',
        format: (t) => `${(t.todayPt || '----')} pt`,
        compare: compareFactory<DiscModel, number | undefined>({
          apply: model => model.todayPt,
          check: value => value === undefined,
          compare: (a, b) => b! - a!
        }),
      },
      {
        key: 'totalPt',
        title: '累积',
        format: (t) => `${(t.totalPt || '----')} pt`,
        compare: compareFactory<DiscModel, number | undefined>({
          apply: model => model.totalPt,
          check: value => value === undefined,
{'fraction_non_alphanumeric': 0.17674554484370436, 'fraction_numerical': 0.00029214139643587495, 'mean_word_length': 2.424, 'pattern_counts': {'":': 0, '<': 15, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3859952', 'n_tokens_mistral': 1056, 'n_tokens_neox': 1058, 'n_words': 273}