1
Fork 0
mirror of https://github.com/Steffo99/festa.git synced 2024-12-25 08:04:22 +00:00
festa/components/errors/ErrorInline.tsx

27 lines
711 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 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
&nbsp;
2022-06-04 03:13:19 +00:00
{props.text ?
<>
<span>
{props.text}
</span>
&nbsp;
</>
: null}
2022-06-02 02:26:52 +00:00
<code lang="json">
{JSON.stringify(props.error)}
</code>
</span>
)
}