<commit_before>/**
 * @providesModule CaseList
 * @flow
 */

import React from 'react'
import styled from 'styled-components'
import { FormattedMessage } from 'react-intl'

import { CaseRow, CaseLinkRow } from 'catalog/shared'

import type { Case } from 'redux/state'

type Props = { cases: Case[], readerIsEditor: boolean }
const CaseList = ({ cases, readerIsEditor }: Props) => (
  <UnstyledList>
    {cases.map(kase => {
      const link = kase.publishedAt || readerIsEditor
      const Row = link ? CaseLinkRow : CaseRow
      return (
        <li key={kase.slug}>
          <Row href={link ? kase.links.self : undefined}>
            <Image src={kase.smallCoverUrl} />
            <Title>
              <Kicker>
                {kase.kicker}
                {!kase.publishedAt && <Forthcoming />}
              </Kicker>
              {kase.title}
            </Title>
          </Row>
        </li>
      )
    })}
  </UnstyledList>
)

export default CaseList

const UnstyledList = styled.ul`
  margin: 0;
  padding: 0;
  list-style: none;
`

const Image = styled.img.attrs({ role: 'presentation' })`
  width: 50px;
  min-width: 50px;<commit_msg>fix: make every case in the catalog a link; now they’re all accessible<commit_after>/**
 * @providesModule CaseList
 * @flow
 */

import React from 'react'
import styled from 'styled-components'
import { FormattedMessage } from 'react-intl'

import { CaseLinkRow } from 'catalog/shared'

import type { Case } from 'redux/state'

type Props = { cases: Case[], readerIsEditor: boolean }
const CaseList = ({ cases, readerIsEditor }: Props) => (
  <UnstyledList>
    {cases.map(kase => {
      return (
        <li key={kase.slug}>
          <CaseLinkRow href={kase.links.self}>
            <Image src={kase.smallCoverUrl} />
            <Title>
              <Kicker>
                {kase.kicker}
                {!kase.publishedAt && <Forthcoming />}
              </Kicker>
              {kase.title}
            </Title>
          </CaseLinkRow>
        </li>
      )
    })}
  </UnstyledList>
)

export default CaseList

const UnstyledList = styled.ul`
  margin: 0;
  padding: 0;
  list-style: none;
`

const Image = styled.img.attrs({ role: 'presentation' })`
  width: 50px;
  min-width: 50px;
{'fraction_non_alphanumeric': 0.1347864768683274, 'fraction_numerical': 0.005338078291814947, 'mean_word_length': 2.2641509433962264, 'pattern_counts': {'":': 0, '<': 27, '<?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': '5089792', 'n_tokens_mistral': 745, 'n_tokens_neox': 725, 'n_words': 177}