2022-06-02 02:26:52 +00:00
|
|
|
import { faCircleExclamation } from "@fortawesome/free-solid-svg-icons";
|
2022-06-04 03:13:19 +00:00
|
|
|
import { FestaIcon } from "../extensions/FestaIcon";
|
2022-06-02 02:26:52 +00:00
|
|
|
|
|
|
|
type ErrorBlockProps = {
|
2022-06-04 03:13:19 +00:00
|
|
|
error: Error,
|
2022-06-02 02:34:40 +00:00
|
|
|
text: string
|
2022-06-02 02:26:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export function ErrorBlock(props: ErrorBlockProps) {
|
|
|
|
return (
|
|
|
|
<div className="error error-block negative">
|
|
|
|
<p>
|
2022-06-03 01:56:43 +00:00
|
|
|
<FestaIcon icon={faCircleExclamation} />
|
2022-06-02 02:26:52 +00:00
|
|
|
|
|
|
|
<span>
|
2022-06-02 02:34:40 +00:00
|
|
|
{props.text}
|
2022-06-02 02:26:52 +00:00
|
|
|
</span>
|
|
|
|
</p>
|
|
|
|
<pre>
|
2022-06-04 03:13:19 +00:00
|
|
|
<code>
|
|
|
|
<b>{props.error.name}</b>
|
|
|
|
:
|
|
|
|
{props.error.message}
|
2022-06-02 02:26:52 +00:00
|
|
|
</code>
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|