- FormField: label, htmlFor, helperText, error, required, children - FilterBar: responsive layout container with children and actions - EmptyState: semantic heading with optional description and action - ErrorState: semantic heading with optional description and action - LoadingState: aria-live polite, section/page sizes, reduced-motion
21 lines
559 B
TypeScript
21 lines
559 B
TypeScript
import type { ReactNode } from 'react';
|
|
import { Stack } from '@mui/material';
|
|
import { Heading } from '../Heading';
|
|
import { Text } from '../Text';
|
|
|
|
export interface ErrorStateProps {
|
|
title: string;
|
|
description?: string;
|
|
action?: ReactNode;
|
|
}
|
|
|
|
export function ErrorState({ title, description, action }: ErrorStateProps) {
|
|
return (
|
|
<Stack spacing={1} alignItems="center" data-testid="error-state">
|
|
<Heading as="h2">{title}</Heading>
|
|
{description && <Text>{description}</Text>}
|
|
{action && <div>{action}</div>}
|
|
</Stack>
|
|
);
|
|
}
|