mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-25 20:09:11 +00:00
29 lines
877 B
TypeScript
29 lines
877 B
TypeScript
import { DotOverlay } from '@roleypoly/design-system/atoms/dot-overlay';
|
|
import { Hero } from '@roleypoly/design-system/atoms/hero';
|
|
import {
|
|
ErrorBanner,
|
|
ErrorMessage,
|
|
} from '@roleypoly/design-system/molecules/error-banner';
|
|
import { AppShell } from '@roleypoly/design-system/organisms/app-shell';
|
|
import { DiscordUser } from '@roleypoly/types';
|
|
import * as React from 'react';
|
|
import { getMessageFromCode } from './errorStrings';
|
|
|
|
export type ErrorProps = {
|
|
code: string | number;
|
|
messageOverride?: ErrorMessage;
|
|
user?: DiscordUser | null;
|
|
};
|
|
|
|
export const Error = (props: ErrorProps) => {
|
|
const messageFromCode = getMessageFromCode(props.code);
|
|
|
|
return (
|
|
<AppShell user={props.user || undefined}>
|
|
<DotOverlay />
|
|
<Hero topSpacing={100} bottomSpacing={25}>
|
|
<ErrorBanner message={messageFromCode} />
|
|
</Hero>
|
|
</AppShell>
|
|
);
|
|
};
|