diff options
Diffstat (limited to 'src/components/organisms/layout/no-results.tsx')
| -rw-r--r-- | src/components/organisms/layout/no-results.tsx | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/components/organisms/layout/no-results.tsx b/src/components/organisms/layout/no-results.tsx new file mode 100644 index 0000000..2245dbf --- /dev/null +++ b/src/components/organisms/layout/no-results.tsx @@ -0,0 +1,38 @@ +import SearchForm, { + type SearchFormProps, +} from '@components/organisms/forms/search-form'; +import { FC } from 'react'; +import { useIntl } from 'react-intl'; + +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; |
