<commit_before>import { groupBy } from "lodash"
import { RouterLink } from "System/Router/RouterLink"
import { extractNodes } from "Utils/extractNodes"
import { ArtistCVGroup_artist } from "__generated__/ArtistCVGroup_artist.graphql"
import { Text, Box, GridColumns, Column, Button } from "@artsy/palette"
import {
  createPaginationContainer,
  graphql,
  RelayPaginationProp,
} from "react-relay"
import { useState, Fragment, FC } from "react"

const REFETCH_PAGE_SIZE = 10

interface ArtistCVGroupProps {
  artist: ArtistCVGroup_artist
  relay: RelayPaginationProp
  title: string
}

const ArtistCVGroup: FC<ArtistCVGroupProps> = ({ artist, relay, title }) => {
  const [isLoading, setIsLoading] = useState(false)
  const hasMore = artist.showsConnection?.pageInfo.hasNextPage

  const loadMore = () => {
    setIsLoading(true)

    relay.loadMore(REFETCH_PAGE_SIZE, error => {
      setIsLoading(false)

      if (error) {
        console.error(error)
      }
    })
  }

  const nodes = extractNodes(artist.showsConnection)

  if (nodes.length === 0) {
    return (
      <GridColumns>
        <Column span={12}>
          <Text variant="lg-display">{title}</Text>
        </Column>
        <Column span={8} start={4}>
          <Text variant="sm-display">
            This dumb artist has no {title.toLowerCase()} yet.<commit_msg>Remove mistake from rebasing<commit_after>import { groupBy } from "lodash"
import { RouterLink } from "System/Router/RouterLink"
import { extractNodes } from "Utils/extractNodes"
import { ArtistCVGroup_artist } from "__generated__/ArtistCVGroup_artist.graphql"
import { Text, Box, GridColumns, Column, Button } from "@artsy/palette"
import {
  createPaginationContainer,
  graphql,
  RelayPaginationProp,
} from "react-relay"
import { useState, Fragment, FC } from "react"

const REFETCH_PAGE_SIZE = 10

interface ArtistCVGroupProps {
  artist: ArtistCVGroup_artist
  relay: RelayPaginationProp
  title: string
}

const ArtistCVGroup: FC<ArtistCVGroupProps> = ({ artist, relay, title }) => {
  const [isLoading, setIsLoading] = useState(false)
  const hasMore = artist.showsConnection?.pageInfo.hasNextPage

  const loadMore = () => {
    setIsLoading(true)

    relay.loadMore(REFETCH_PAGE_SIZE, error => {
      setIsLoading(false)

      if (error) {
        console.error(error)
      }
    })
  }

  const nodes = extractNodes(artist.showsConnection)

  if (nodes.length === 0) {
    return (
      <GridColumns>
        <Column span={12}>
          <Text variant="lg-display">{title}</Text>
        </Column>
        <Column span={8} start={4}>
          <Text variant="sm-display">
            This artist has no {title.toLowerCase()} yet.
{'fraction_non_alphanumeric': 0.11707680835197613, 'fraction_numerical': 0.005219985085756898, 'mean_word_length': 3.649913344887348, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 25, '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': '4149454', 'n_tokens_mistral': 851, 'n_tokens_neox': 850, 'n_words': 189}