Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 105x 4x 4x 1x | import { XCircleIcon } from "lucide-react";
import { ReactQueryApiError } from "shared-types";
import * as UI from "@/components";
export const ErrorAlert = ({ error }: { error: ReactQueryApiError }) => {
let message = "An error has occurred";
if (error?.response?.data?.message) {
message = error.response.data.message;
}
return (
<UI.Alert className="border-2" variant="destructive">
<XCircleIcon className="w-6 h-6" />
<UI.AlertTitle>Error</UI.AlertTitle>
<UI.AlertDescription>{message}</UI.AlertDescription>
</UI.Alert>
);
};
|