Styles, API calls, and more
This commit is contained in:
16
src/components/ToastError.tsx
Normal file
16
src/components/ToastError.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
import { Stack, Text } from '@mantine/core';
|
||||
import { stackClasses } from '../styles';
|
||||
|
||||
export function ToastError({ err }: { err: any }) {
|
||||
const errorResponse = JSON.parse(err.message);
|
||||
return (
|
||||
<Stack className={stackClasses.VStack} style={{ alignItems: 'flex-start' }}>
|
||||
<Text>
|
||||
Status: {errorResponse.status} {errorResponse.statusText}
|
||||
</Text>
|
||||
<Text>Details: {errorResponse.msg}</Text>
|
||||
{errorResponse.loc && <Text>Location: {errorResponse.loc}</Text>}
|
||||
{errorResponse.type && <Text>Type: {errorResponse.type}</Text>}
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user