MCPcopy Create free account
hub / github.com/coderoad/coderoad-vscode / ErrorMarkdown

Function ErrorMarkdown

web-app/src/components/Error/index.tsx:42–73  ·  view source on GitHub ↗
({ error, send }: Props)

Source from the content-addressed store, hash-verified

40}
41
42const ErrorMarkdown = ({ error, send }: Props) => {
43 React.useEffect(() => {
44 if (error) {
45 // log error
46 logger(`ERROR in markdown: ${error.message}`)
47 }
48 }, [error])
49
50 if (!error) {
51 return null
52 }
53
54 return (
55 <div css={styles.container}>
56 <h1>Oops!</h1>
57 <div css={styles.content}>
58 <Markdown>{error.message}</Markdown>
59 </div>
60 <br />
61 <br />
62 {/* Actions */}
63 <div css={styles.options}>
64 {error.actions &&
65 error.actions.map((a) => (
66 <Button type="normal" warning style={styles.button} onClick={() => send({ type: a.transition })}>
67 {a.label}
68 </Button>
69 ))}
70 </div>
71 </div>
72 )
73}
74
75export default ErrorMarkdown

Callers

nothing calls this directly

Calls 2

loggerFunction · 0.50
sendFunction · 0.50

Tested by

no test coverage detected