forked from algolia/docsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathErrorScreen.tsx
More file actions
26 lines (22 loc) · 721 Bytes
/
ErrorScreen.tsx
File metadata and controls
26 lines (22 loc) · 721 Bytes
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
import React, { type JSX } 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>
);
}