<commit_before>import IconTime from 'react-icons/lib/md/access-time'
import {Highlight} from 'react-instantsearch/dom'
import React from 'react'

import Badge from '../Badge'

import './style.scss'

const getTimestamp = item => item.updatedAt || item.createdAt

const renderTimeIcon = time => (
  <Badge
    iconComponent={<IconTime size={20} />}
    className='ml1'>{time}</Badge>
)

const isRecently = (timestamp, hours) => {
  const lastHours = 1000 * 60 * 60 * hours
  return Date.now() - timestamp < lastHours
}

const getTimeIcon = timestamp => {
  if (isRecently(timestamp, 24)) return renderTimeIcon('24 Hours')
  if (isRecently(timestamp, 48)) return renderTimeIcon('48 Hours')
  if (isRecently(timestamp, 72)) return renderTimeIcon('3 Days')
  if (isRecently(timestamp, 120)) return renderTimeIcon('1 Week')
  return renderTimeIcon('1 Month')
}

const renderPopularIcon = rarity => {
  return (
    <Badge
      iconComponent={
        <img
          alt={rarity}
          className='v-mid'
          src={`/assets/img/popular/${rarity}.svg`}
        />
      }
      className='mr1'>{rarity}</Badge>
  )
}

function getPopularIcon (item) {
  const {priceScore} = item
  if (priceScore < 0.5) return
  if (priceScore > 0.95) return renderPopularIcon('legendary')
  if (priceScore > 0.80) return renderPopularIcon('epic')
  if (priceScore > 0.70) return renderPopularIcon('rare')
  return renderPopularIcon('uncommon')
}

function getImageUrl (item) {
  const {image, provider} = item
  if (!image) return `/assets/img/provider/${provider}.jpg`<commit_msg>Update copy<commit_after>import IconTime from 'react-icons/lib/md/access-time'
import {Highlight} from 'react-instantsearch/dom'
import React from 'react'

import Badge from '../Badge'

import './style.scss'

const getTimestamp = item => item.updatedAt || item.createdAt

const renderTimeIcon = time => (
  <Badge
    iconComponent={<IconTime size={20} />}
    className='ml1'>{time}</Badge>
)

const isRecently = (timestamp, hours) => {
  const lastHours = 1000 * 60 * 60 * hours
  return Date.now() - timestamp < lastHours
}

const getTimeIcon = timestamp => {
  if (isRecently(timestamp, 24)) return renderTimeIcon('24 hours')
  if (isRecently(timestamp, 48)) return renderTimeIcon('48 hours')
  if (isRecently(timestamp, 72)) return renderTimeIcon('3 days')
  if (isRecently(timestamp, 120)) return renderTimeIcon('1 week')
  return renderTimeIcon('1-3 months')
}

const renderPopularIcon = rarity => {
  return (
    <Badge
      iconComponent={
        <img
          alt={rarity}
          className='v-mid'
          src={`/assets/img/popular/${rarity}.svg`}
        />
      }
      className='mr1'>{rarity}</Badge>
  )
}

function getPopularIcon (item) {
  const {priceScore} = item
  if (priceScore < 0.5) return
  if (priceScore > 0.95) return renderPopularIcon('legendary')
  if (priceScore > 0.80) return renderPopularIcon('epic')
  if (priceScore > 0.70) return renderPopularIcon('rare')
  return renderPopularIcon('uncommon')
}

function getImageUrl (item) {
  const {image, provider} = item
  if (!image) return `/assets/img/provider/${provider}.jpg`
{'fraction_non_alphanumeric': 0.14267475263325885, 'fraction_numerical': 0.025215448451962975, 'mean_word_length': 3.9045383411580596, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 31, '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': '1162605', 'n_tokens_mistral': 1074, 'n_tokens_neox': 1003, 'n_words': 246}