1
Fork 0
mirror of https://github.com/Steffo99/festa.git synced 2024-10-16 15:07:27 +00:00
festa/components/ErrorInline.tsx

26 lines
682 B
TypeScript
Raw Normal View History

2022-06-02 02:26:52 +00:00
import { faCircleExclamation } from "@fortawesome/free-solid-svg-icons";
import { useTranslation } from "next-i18next";
import { FestaIcon } from "./FestaIcon";
type ErrorInlineProps = {
error: JSON,
text?: string
}
export function ErrorInline(props: ErrorInlineProps) {
const {t} = useTranslation()
return (
<span className="error error-inline negative">
<FestaIcon icon={faCircleExclamation}/>
&nbsp;
<span>
{props.text ?? t("genericError")}
</span>
&nbsp;
<code lang="json">
{JSON.stringify(props.error)}
</code>
</span>
)
}