<commit_before>import { Box, Flex, SkeletonText, Sup, Text as BaseText } from "@artsy/palette"
import React from "react"
import { RouterLink } from "v2/System/Router/RouterLink"

export interface RailHeaderProps {
  countLabel?: number
  isLoading?: boolean
  title: string
  subTitle?: string
  viewAllHref?: string
  viewAllLabel?: string
  viewAllOnClick?(event: React.MouseEvent<HTMLElement, MouseEvent>): void
}

export const RailHeader: React.FC<RailHeaderProps> = ({
  countLabel,
  isLoading = false,
  title,
  subTitle,
  viewAllHref,
  viewAllLabel,
  viewAllOnClick = () => null,
}) => {
  const showViewAll = Boolean(viewAllLabel && viewAllHref)

  const Text = isLoading ? SkeletonText : BaseText

  return (
    <Flex justifyContent="space-between" alignItems="center">
      <Box>
        <Text variant="lg" as="h3">
          {title}{" "}
          {countLabel && countLabel > 1 && (
            <Sup color="brand">{countLabel}</Sup>
          )}
        </Text>

        {subTitle && (
          <Text as="h3" variant="lg" color="black60">
            {subTitle}
          </Text>
        )}<commit_msg>Link Rails to the view all location<commit_after>import { Box, Flex, SkeletonText, Sup, Text as BaseText } from "@artsy/palette"
import React from "react"
import { RouterLink } from "v2/System/Router/RouterLink"

export interface RailHeaderProps {
  countLabel?: number
  isLoading?: boolean
  title: string
  subTitle?: string
  viewAllHref?: string
  viewAllLabel?: string
  viewAllOnClick?(event: React.MouseEvent<HTMLElement, MouseEvent>): void
}

export const RailHeader: React.FC<RailHeaderProps> = ({
  countLabel,
  isLoading = false,
  title,
  subTitle,
  viewAllHref,
  viewAllLabel,
  viewAllOnClick = () => null,
}) => {
  const showViewAll = Boolean(viewAllLabel && viewAllHref)

  const Text = isLoading ? SkeletonText : BaseText

  return (
    <Flex justifyContent="space-between" alignItems="center">
      <Box>
        <Text variant="lg" as="h3">
          <RouterLink
            // @ts-ignore
            to={viewAllHref}
            onClick={viewAllOnClick}
          >
            {title}
          </RouterLink>{" "}
          {countLabel && countLabel > 1 && (
            <Sup color="brand">{countLabel}</Sup>
          )}
        </Text>

        {subTitle && (
          <Text as="h3" variant="lg" color="black60">
            {subTitle}
          </Text>
        )}
{'fraction_non_alphanumeric': 0.12789735099337748, 'fraction_numerical': 0.004966887417218543, 'mean_word_length': 2.800314465408805, 'pattern_counts': {'":': 0, '<': 25, '<?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': '6597633', 'n_tokens_mistral': 765, 'n_tokens_neox': 744, 'n_words': 173}