1
Fork 0
mirror of https://github.com/Steffo99/festa.git synced 2024-10-16 15:07:27 +00:00
festa/components/errors/ErrorInline.tsx
2022-06-04 05:13:19 +02:00

27 lines
No EOL
711 B
TypeScript

import { faCircleExclamation } from "@fortawesome/free-solid-svg-icons";
import { FestaIcon } from "../extensions/FestaIcon";
type ErrorInlineProps = {
error: Error,
text?: string
}
export function ErrorInline(props: ErrorInlineProps) {
return (
<span className="error error-inline negative">
<FestaIcon icon={faCircleExclamation} />
&nbsp;
{props.text ?
<>
<span>
{props.text}
</span>
&nbsp;
</>
: null}
<code lang="json">
{JSON.stringify(props.error)}
</code>
</span>
)
}