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 ErrorInlineProps = {
|
2022-06-04 03:13:19 +00:00
|
|
|
error: Error,
|
2022-06-02 02:26:52 +00:00
|
|
|
text?: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export function ErrorInline(props: ErrorInlineProps) {
|
|
|
|
return (
|
|
|
|
<span className="error error-inline negative">
|
2022-06-03 01:56:43 +00:00
|
|
|
<FestaIcon icon={faCircleExclamation} />
|
2022-06-02 02:26:52 +00:00
|
|
|
|
2022-06-04 03:13:19 +00:00
|
|
|
{props.text ?
|
|
|
|
<>
|
|
|
|
<span>
|
|
|
|
{props.text}
|
|
|
|
</span>
|
|
|
|
|
|
|
|
</>
|
|
|
|
: null}
|
2022-06-02 02:26:52 +00:00
|
|
|
<code lang="json">
|
|
|
|
{JSON.stringify(props.error)}
|
|
|
|
</code>
|
|
|
|
</span>
|
|
|
|
)
|
|
|
|
}
|