1
Fork 0
mirror of https://github.com/Steffo99/festa.git synced 2024-12-23 15:14:23 +00:00
festa/components/errors/ErrorBlock.tsx

28 lines
725 B
TypeScript
Raw Normal View History

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,
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
&nbsp;
<span>
{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>
:&nbsp;
{props.error.message}
2022-06-02 02:26:52 +00:00
</code>
</pre>
</div>
)
}