jsketcher/modules/ui/components/ErrorMessage.tsx
2020-05-21 17:19:15 -07:00

26 lines
No EOL
452 B
TypeScript

import React from "react";
import {GrStatusWarning} from "react-icons/gr";
export function ErrorMessage({error}: {
error: Error|string
}) {
let msg;
if (typeof error === 'string') {
msg = error;
} else {
msg = error.message;
}
return <div style={{
display: 'flex',
alignItems: 'center',
color: 'salmon'
}}>
<GrStatusWarning size={32} style={{
paddingRight: '10px'
}}/>
<div>{msg}</div>
</div>
}