349194e7e5
- RouteError: raw <div>/<h2>/<p>/<button> (sans-serif, raw px) -> folds Box/Text/Button with config tokens. - CallEmbedProvider PiP fullscreen control: raw <button> with ⊡/⛶ glyphs -> folds IconButton reusing the exported FullscreenIcon/ExitFullscreenIcon SVGs from Controls (consistent with the main fullscreen button). The intentional dark over-video scrim is kept. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
34 lines
946 B
TypeScript
34 lines
946 B
TypeScript
import React from 'react';
|
|
import { useRouteError, isRouteErrorResponse } from 'react-router-dom';
|
|
import { Box, Button, config, Text, toRem } from 'folds';
|
|
|
|
export function RouteError() {
|
|
const error = useRouteError();
|
|
|
|
const message = isRouteErrorResponse(error)
|
|
? `${error.status} ${error.statusText}`
|
|
: error instanceof Error
|
|
? error.message
|
|
: 'An unexpected error occurred.';
|
|
|
|
return (
|
|
<Box
|
|
direction="Column"
|
|
alignItems="Center"
|
|
justifyContent="Center"
|
|
gap="400"
|
|
style={{ height: '100dvh', padding: config.space.S700 }}
|
|
>
|
|
<Text size="H3">Something went wrong</Text>
|
|
<Text size="T300" priority="300" style={{ textAlign: 'center', maxWidth: toRem(400) }}>
|
|
{message}
|
|
</Text>
|
|
<Button variant="Primary" onClick={() => window.location.reload()}>
|
|
<Text as="span" size="B400">
|
|
Reload
|
|
</Text>
|
|
</Button>
|
|
</Box>
|
|
);
|
|
}
|