<commit_before>import React from "react"
import { Image, ResponsiveBox } from "@artsy/palette"
import { createFragmentContainer, graphql } from "react-relay"
import { FairCard_fair } from "v2/__generated__/FairCard_fair.graphql"

interface FairHeaderImageProps {
  fair: FairCard_fair
}

export const FairCard: React.FC<FairHeaderImageProps> = ({
  fair: { name, image },
}) => {
  return (
    <ResponsiveBox
      aspectWidth={3}
      aspectHeight={2}
      maxWidth="100%"
      bg="black60"
    >
      <Image
        src={image.cropped.src}
        srcSet={image.cropped.srcSet}
        alt={name}
        lazyLoad
        borderRadius="4px"
      />
    </ResponsiveBox>
  )
}

export const FairCardFragmentContainer = createFragmentContainer(FairCard, {
  fair: graphql`
    fragment FairCard_fair on Fair {
      name
      image {
        # Width = largest possible size, full width at 'xs' breakpoint.
        # Height = Width / 1.5<commit_msg>Accommodates missing fair images<commit_after>import React from "react"
import { Image, ResponsiveBox } from "@artsy/palette"
import { createFragmentContainer, graphql } from "react-relay"
import { FairCard_fair } from "v2/__generated__/FairCard_fair.graphql"

interface FairHeaderImageProps {
  fair: FairCard_fair
}

export const FairCard: React.FC<FairHeaderImageProps> = ({
  fair: { name, image },
}) => {
  return (
    <ResponsiveBox
      aspectWidth={3}
      aspectHeight={2}
      maxWidth="100%"
      bg="black10"
      borderRadius={4}
    >
      {image && (
        <Image
          src={image.cropped.src}
          srcSet={image.cropped.srcSet}
          alt={name}
          lazyLoad
          borderRadius={4}
        />
      )}
    </ResponsiveBox>
  )
}

export const FairCardFragmentContainer = createFragmentContainer(FairCard, {
  fair: graphql`
    fragment FairCard_fair on Fair {
      name
      image {
        # Width = largest possible size, full width at 'xs' breakpoint.
        # Height = Width / 1.5
{'fraction_non_alphanumeric': 0.10798593671521849, 'fraction_numerical': 0.011551983927674536, 'mean_word_length': 2.7942857142857145, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '2622338', 'n_tokens_mistral': 645, 'n_tokens_neox': 617, 'n_words': 136}