16 lines
437 B
TypeScript
16 lines
437 B
TypeScript
import { useTranslation } from "react-i18next";
|
|
|
|
import { ApplicationApiError } from "../api";
|
|
|
|
export function ApplicationFeedback({ error }: { error: Error | null }) {
|
|
const { t } = useTranslation("companies");
|
|
|
|
return error ? (
|
|
<p className="text-sm text-destructive" role="alert">
|
|
{t(
|
|
`applications.errors.${error instanceof ApplicationApiError ? error.code : "INTERNAL_ERROR"}`
|
|
)}
|
|
</p>
|
|
) : null;
|
|
}
|