Continuous Integration / build_web (push) Failing after 0s
Continuous Integration / build (macos-latest) (push) Skipped
Continuous Integration / build (ubuntu-22.04) (push) Skipped
Continuous Integration / build (windows-11-arm) (push) Skipped
Continuous Integration / build (windows-latest) (push) Skipped
Continuous Integration / nightly_release (push) Skipped
Adds frameless-window controls for Windows/Linux (native traffic lights on macOS), keeps transfers at the current position for video, lets the video player use the same sync/device controls as the media bar, and removes dead code plus assorted UI/perf issues.
74 lines
1.6 KiB
TypeScript
74 lines
1.6 KiB
TypeScript
import Box from "@mui/material/Box";
|
|
import Typography from "@mui/material/Typography";
|
|
import { red } from "@mui/material/colors";
|
|
import React from "react";
|
|
|
|
export const ErrorNotice = ({ error }: { error?: unknown }) => {
|
|
const normalizedError =
|
|
error instanceof Error
|
|
? error
|
|
: error
|
|
? new Error(String(error))
|
|
: undefined;
|
|
console.error(normalizedError ?? error);
|
|
return (
|
|
<Box
|
|
sx={{
|
|
width: "100%",
|
|
height: "100vh",
|
|
display: "flex",
|
|
justifyContent: "center",
|
|
alignItems: "center",
|
|
flexFlow: "column",
|
|
// opacity: 0.2,
|
|
}}
|
|
>
|
|
<div
|
|
className="material-symbols-rounded animate-icon"
|
|
style={{
|
|
fontSize: "10em",
|
|
color: red[800],
|
|
//@ts-ignore
|
|
"--clr": "rgb(198 40 40 / 30%)",
|
|
fontVariationSettings: '"FILL" 1, "wght" 400, "GRAD" 25, "opsz" 60',
|
|
}}
|
|
>
|
|
error
|
|
</div>
|
|
<Typography
|
|
variant="h3"
|
|
sx={{
|
|
color: "white",
|
|
fontWeight: 300,
|
|
}}
|
|
>
|
|
Something went wrong.
|
|
</Typography>
|
|
<Typography
|
|
variant="body2"
|
|
component="pre"
|
|
style={{
|
|
padding: "0.5em",
|
|
background: "rgb(0 0 0 / 1)",
|
|
borderRadius: "8px",
|
|
border: "2px dashed rgb(255 255 255 / 0.5)",
|
|
maxWidth: "40em",
|
|
maxHeight: "20em",
|
|
overflow: "auto",
|
|
marginTop: "1em",
|
|
whiteSpace: "pre-wrap",
|
|
}}
|
|
sx={{
|
|
color: "grey.400",
|
|
fontFamily: "JetBrains Mono Variable",
|
|
}}
|
|
>
|
|
{normalizedError
|
|
? normalizedError.stack ||
|
|
`${normalizedError.name}: ${normalizedError.message}`
|
|
: "Unknown error"}
|
|
</Typography>
|
|
</Box>
|
|
);
|
|
};
|