MCPcopy
hub / github.com/github/docs / SearchError

Function SearchError

components/search/SearchError.tsx:10–27  ·  view source on GitHub ↗
({ error }: Props)

Source from the content-addressed store, hash-verified

8}
9
10export function SearchError({ error }: Props) {
11 const { t } = useTranslation('search')
12 const { locale, asPath } = useRouter()
13
14 return (
15 <div>
16 <Flash variant="danger" sx={{ margin: '3rem' }}>
17 {t('search_error')}
18 <br />
19 {process.env.NODE_ENV === 'development' && <code>{error.toString()}</code>}
20 </Flash>
21 <Box>
22 {/* This deliberately uses a <a> instead of <Link> so it triggers a full reload. */}
23 <a href={`/${locale}${asPath}`}>Try reloading the page</a>
24 </Box>
25 </div>
26 )
27}

Callers

nothing calls this directly

Calls 1

useTranslationFunction · 0.90

Tested by

no test coverage detected