1
0
Fork 0
docsearch/packages/docsearch-react/src/ErrorScreen.tsx
Pierre Millot aa666deccc
chore(deps): dependencies 2024-11-04 (#2335)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-04 18:15:51 +01:00

26 lines
707 B
TypeScript

import React from 'react';
import { ErrorIcon } from './icons';
export type ErrorScreenTranslations = Partial<{
titleText: string;
helpText: string;
}>;
type ErrorScreenProps = {
translations?: ErrorScreenTranslations;
};
export function ErrorScreen({ translations = {} }: ErrorScreenProps): JSX.Element {
const { titleText = 'Unable to fetch results', helpText = 'You might want to check your network connection.' } =
translations;
return (
<div className="DocSearch-ErrorScreen">
<div className="DocSearch-Screen-Icon">
<ErrorIcon />
</div>
<p className="DocSearch-Title">{titleText}</p>
<p className="DocSearch-Help">{helpText}</p>
</div>
);
}