Sergey Krylov 55221dbf22 feat(design-system): add form and page-state patterns
- 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
2026-06-21 09:44:12 +03:00

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>
);
}