Some checks failed
CI / lint-typecheck (pull_request) Failing after 10s
CI / tests (pull_request) Has been skipped
CI / contract-tests (pull_request) Has been skipped
CI / e2e-tests (pull_request) Has been skipped
CI / comment-pr (pull_request) Has been skipped
CI / commit-types (pull_request) Has been skipped
40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
|
|
|
|
import { TemplateProps } from '@/lib/contracts/components/ComponentContracts';
|
|
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
|
import { Container } from '@/ui/Container';
|
|
import { Stack } from '@/ui/Stack';
|
|
import { Text } from '@/ui/Text';
|
|
|
|
interface ErrorTemplateProps extends TemplateProps<ViewData> {
|
|
message?: string;
|
|
description?: string;
|
|
}
|
|
|
|
export function ErrorTemplate({ message = "An error occurred", description = "Please try again later" }: ErrorTemplateProps) {
|
|
return (
|
|
<Container size="lg">
|
|
<Stack align="center" gap={4} py={12}>
|
|
<Text color="text-red-400">{message}</Text>
|
|
<Text color="text-gray-400">{description}</Text>
|
|
</Stack>
|
|
</Container>
|
|
);
|
|
}
|
|
|
|
interface EmptyTemplateProps extends TemplateProps<ViewData> {
|
|
title: string;
|
|
description: string;
|
|
}
|
|
|
|
export function EmptyTemplate({ title, description }: EmptyTemplateProps) {
|
|
return (
|
|
<Container size="lg">
|
|
<Stack align="center" gap={2} py={12}>
|
|
<Text data-testid="empty-state-title" size="xl" weight="semibold" color="text-white">{title}</Text>
|
|
<Text data-testid="empty-state-description" color="text-gray-400">{description}</Text>
|
|
</Stack>
|
|
</Container>
|
|
);
|
|
}
|