mirror of
https://github.com/Steffo99/festa.git
synced 2024-12-23 07:04:22 +00:00
26 lines
No EOL
682 B
TypeScript
26 lines
No EOL
682 B
TypeScript
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}/>
|
|
|
|
<span>
|
|
{props.text ?? t("genericError")}
|
|
</span>
|
|
|
|
<code lang="json">
|
|
{JSON.stringify(props.error)}
|
|
</code>
|
|
</span>
|
|
)
|
|
} |