Files
animethemes-web/src/components/card/ErrorCard.tsx
T
Mani 1f0844465c feat: Added proper path alias for imports (#216)
* Added "Share" and "Add to Playlist" buttons to video player overlay.
* Added options to sort playlists in reverse order.
* Added handle for dragging playlist items.
* Added consistent import sorting (with ESLint).
* Removed barrel files.
2024-05-22 17:30:26 +02:00

44 lines
1.2 KiB
TypeScript

import styled from "styled-components";
import { faExclamation } from "@fortawesome/pro-solid-svg-icons";
import { Row } from "@/components/box/Flex";
import { Card } from "@/components/card/Card";
import { Icon } from "@/components/icon/Icon";
import { Text } from "@/components/text/Text";
import theme from "@/theme";
const StyledCard = styled(Card)`
display: flex;
flex-direction: column;
gap: 16px;
`;
const StyledErrorMessage = styled(Text).attrs({ variant: "code" })`
display: block;
background-color: ${theme.colors["solid-on-card"]};
overflow: auto;
`;
interface ErrorCardProps {
error: unknown
}
export function ErrorCard({ error }: ErrorCardProps) {
return (
<StyledCard color="text-warning">
<Row style={{ "--gap": "1rem" }}>
<Text color="text-warning">
<Icon icon={faExclamation}/>
</Text>
<Text block>An error occurred while searching! Help improving the site by sending us the following error message:</Text>
</Row>
<pre>
<StyledErrorMessage>
{JSON.stringify(error, null, 2)}
</StyledErrorMessage>
</pre>
</StyledCard>
);
}