aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/organisms/layout/no-results.tsx
blob: 1b563daaafb7939ea360133a29ce3ab14514e992 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { FC } from 'react';
import { useIntl } from 'react-intl';
import SearchForm, {
  type SearchFormProps,
} from '../../organisms/forms/search-form';

export type NoResultsProps = Pick<SearchFormProps, 'searchPage'>;

/**
 * NoResults component
 *
 * Renders a no results text with a search form.
 */
const NoResults: FC<NoResultsProps> = ({ searchPage }) => {
  const intl = useIntl();

  return (
    <>
      <p>
        {intl.formatMessage({
          defaultMessage: 'No results found.',
          description: 'NoResults: no results',
          id: '5O2vpy',
        })}
      </p>
      <p>
        {intl.formatMessage({
          defaultMessage: 'Would you like to try a new search?',
          description: 'NoResults: try a new search message',
          id: 'DVBwfu',
        })}
      </p>
      <SearchForm hideLabel={true} searchPage={searchPage} />
    </>
  );
};

export default NoResults;