<commit_before>/* eslint-disable camelcase */
import React, { useContext } from 'react'
import Link from 'redux-first-router-link'
import styled from '@datapunt/asc-core'
import NoResultsForSearchType from '../Messages/NoResultsForSearchType'
import PAGES from '../../pages'
import { getByUrl } from '../../../shared/services/api/api'
import { ArticleSearchContext, PublicationSearchContext } from './editorialSearchContexts'
import { useArticleSearchDuck, usePublicationSearchDuck } from './editorialSearchHooks'
import useNormalizedCMSResults from '../../../normalizations/cms/useNormalizedCMSResults'
import EditorialResults from '../EditorialResults'
import ShareBar from '../ShareBar/ShareBar'
import { toArticleOverview, toPublicationOverview } from '../../../store/redux-first-router/actions'
import { EDITORIAL_TITLES } from '../../pages/EditorialOverviewPage/constants'

const contextMapping = {
  [PAGES.ARTICLES]: ArticleSearchContext,
  [PAGES.PUBLICATIONS]: PublicationSearchContext,
}

const ducksMapping = {
  [PAGES.ARTICLES]: useArticleSearchDuck,
  [PAGES.PUBLICATIONS]: usePublicationSearchDuck,
}

const routeMapping = {
  [PAGES.ARTICLES]: toArticleOverview,
  [PAGES.PUBLICATIONS]: toPublicationOverview,
}

const StyledShareBar = styled(ShareBar)`
  margin-top: 24px;
`

const StyledEditorialSearch = styled.div`
  margin-bottom: 24px;
`

const EditorialSearch = ({ type }) => {
  const [{ results, loading }, dispatch] = useContext(contextMapping[type])
  const { actions, selectors } = ducksMapping[type]()

  const loadMore = async endpoint => {
    dispatch(actions.request())
    try {
      const payload = await getByUrl(endpoint)
      dispatch(actions.accumulateResults(payload))
    } catch (e) {
      dispatch(actions.failure(e))
    }
  }
<commit_msg>Added max-width on editorial search<commit_after>/* eslint-disable camelcase */
import React, { useContext } from 'react'
import Link from 'redux-first-router-link'
import styled from '@datapunt/asc-core'
import NoResultsForSearchType from '../Messages/NoResultsForSearchType'
import PAGES from '../../pages'
import { getByUrl } from '../../../shared/services/api/api'
import { ArticleSearchContext, PublicationSearchContext } from './editorialSearchContexts'
import { useArticleSearchDuck, usePublicationSearchDuck } from './editorialSearchHooks'
import useNormalizedCMSResults from '../../../normalizations/cms/useNormalizedCMSResults'
import EditorialResults from '../EditorialResults'
import ShareBar from '../ShareBar/ShareBar'
import { toArticleOverview, toPublicationOverview } from '../../../store/redux-first-router/actions'
import { EDITORIAL_TITLES } from '../../pages/EditorialOverviewPage/constants'

const contextMapping = {
  [PAGES.ARTICLES]: ArticleSearchContext,
  [PAGES.PUBLICATIONS]: PublicationSearchContext,
}

const ducksMapping = {
  [PAGES.ARTICLES]: useArticleSearchDuck,
  [PAGES.PUBLICATIONS]: usePublicationSearchDuck,
}

const routeMapping = {
  [PAGES.ARTICLES]: toArticleOverview,
  [PAGES.PUBLICATIONS]: toPublicationOverview,
}

const StyledShareBar = styled(ShareBar)`
  margin-top: 24px;
`

const StyledEditorialSearch = styled.div`
  margin-bottom: 24px;
  max-width: 792px; // Image width + 600px (design system rule)
`

const EditorialSearch = ({ type }) => {
  const [{ results, loading }, dispatch] = useContext(contextMapping[type])
  const { actions, selectors } = ducksMapping[type]()

  const loadMore = async endpoint => {
    dispatch(actions.request())
    try {
      const payload = await getByUrl(endpoint)
      dispatch(actions.accumulateResults(payload))
    } catch (e) {
      dispatch(actions.failure(e))
    }
  }

{'fraction_non_alphanumeric': 0.12868852459016394, 'fraction_numerical': 0.003825136612021858, 'mean_word_length': 4.729264475743349, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '7554392', 'n_tokens_mistral': 1143, 'n_tokens_neox': 1073, 'n_words': 238}