diff --git a/frontend/src/components/ErrorState.jsx b/frontend/src/components/ErrorState.jsx index ecc86aff..5e390a4d 100644 --- a/frontend/src/components/ErrorState.jsx +++ b/frontend/src/components/ErrorState.jsx @@ -12,14 +12,38 @@ import { t } from '@/i18n/t'; * onRetry={loadData} * /> */ -export function ErrorState({ title = 'Something went wrong', message, onRetry, className = '' }) { +export function ErrorState({ + title = t('common.error.failedToLoad', 'Failed to load'), + message, + error, + onRetry, + compact = false, + className = '', +}) { + const errorMessage = message || error?.message + || t('common.error.loadingData', 'An error occurred while loading data'); + + if (compact) { + return ( +
+ + {errorMessage} + {onRetry && ( + + )} +
+ ); + } + return ( -
+

{title}

- {message &&

{message}

} + {errorMessage &&

{errorMessage}

} {onRetry && (