<commit_before>import type { LocationDescriptorObject } from 'history'
import type { FunctionComponent } from 'react'
import styled from 'styled-components'
import SEARCH_PAGE_CONFIG from '../../../pages/SearchPage/config'
import { activeFiltersParam, pageParam, queryParam } from '../../../pages/SearchPage/query-params'
import toSearchParams from '../../../utils/toSearchParams'
import type { AutoSuggestSearchResult } from '../services/auto-suggest/auto-suggest'
import AutoSuggestItem, { StyledLink } from './AutoSuggestItem'

export interface AutoSuggestCategoryProps {
  category: AutoSuggestSearchResult
  highlightValue: string
  inputValue: string
}

const AutoSuggestDropDownCategory = styled.div`
  &:not(:first-of-type) {
    border-top: 1px solid #ccc; // was $secondary-gray
    margin-top: 7px;
    padding-top: 12px;
  }
`
const AutoSuggestDropdownCategoryHeading = styled.h4`
  color: #666; // was $secondary-gray60
  font-weight: 500; // was $medium-weight
  margin: 0 10px calc(${10 / 2}px); // 10px was $base-whitespace
`

const AutoSuggestMoreResults = styled(StyledLink)`
  padding-left: 8px;
  font-size: 14px;
  text-decoration: underline;
  color: #666; // was $secondary-gray60;
`

const AutoSuggestCategory: FunctionComponent<AutoSuggestCategoryProps> = ({
  category,
  highlightValue,
  inputValue,
}) => {
  const { type, label, content, totalResults } = category
  // Todo: Make sure we get a type back from typeahead instead of transforming the label<commit_msg>fix link more results (#4608)<commit_after>import type { LocationDescriptorObject } from 'history'
import type { FunctionComponent } from 'react'
import styled from 'styled-components'
import { Link } from 'react-router-dom'
import SEARCH_PAGE_CONFIG from '../../../pages/SearchPage/config'
import { activeFiltersParam, pageParam, queryParam } from '../../../pages/SearchPage/query-params'
import toSearchParams from '../../../utils/toSearchParams'
import type { AutoSuggestSearchResult } from '../services/auto-suggest/auto-suggest'
import AutoSuggestItem from './AutoSuggestItem'

export interface AutoSuggestCategoryProps {
  category: AutoSuggestSearchResult
  highlightValue: string
  inputValue: string
}

const AutoSuggestDropDownCategory = styled.div`
  &:not(:first-of-type) {
    border-top: 1px solid #ccc; // was $secondary-gray
    margin-top: 7px;
    padding-top: 12px;
  }
`
const AutoSuggestDropdownCategoryHeading = styled.h4`
  color: #666; // was $secondary-gray60
  font-weight: 500; // was $medium-weight
  margin: 0 10px calc(${10 / 2}px); // 10px was $base-whitespace
`

const AutoSuggestMoreResults = styled(Link)`
  padding-left: 8px;
  font-size: 14px;
  text-decoration: underline;
  color: #666; // was $secondary-gray60;
`

const AutoSuggestCategory: FunctionComponent<AutoSuggestCategoryProps> = ({
  category,
  highlightValue,
  inputValue,
}) => {
  const { type, label, content, totalResults } = category
  // Todo: Make sure we get a type back from typeahead instead of transforming the label
{'fraction_non_alphanumeric': 0.12243547319655856, 'fraction_numerical': 0.020516214427531435, 'mean_word_length': 4.379003558718861, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5904751', 'n_tokens_mistral': 964, 'n_tokens_neox': 887, 'n_words': 246}