import { FunctionComponent } from 'react'; import Paper from '@mui/material/Paper'; import Stack from '@mui/material/Stack'; import Typography from '@mui/material/Typography'; import AppButton from '../AppButton'; import AppIcon from '../AppIcon'; export interface ErrorStateProps { /** Already-translated message — page-specific copy stays the caller's job. */ message: string; /** Already-translated retry label (e.g. `t('common.retry')`) — kept caller-owned rather than a * component-internal default so this file never imports next-intl: it sits at the top of the * `common` barrel, and an eager i18n dependency there would drag `next-intl` into every test that * imports anything from `@/components`, mocked or not (see `ErrorBoundary` for the same rule). */ retryLabel: string; /** Required — the convention this component exists to enforce: an error is never a dead end. */ onRetry: () => void; } /** * The calm, branded "something went wrong" panel with a **required** retry affordance — the fix for the * false-empty class of defect (a failed query rendering as "no data" instead of an error). `onRetry` is * mandatory by the type; there is no way to render this component without a way back. Presentational, * caller-owned i18n throughout — everything is already-translated copy. * @component ErrorState */ const ErrorState: FunctionComponent = ({ message, retryLabel, onRetry }) => ( {message} {retryLabel} ); export default ErrorState;