Files
accounted/components/settings/SettingsLoadError.tsx
T
Mattsson 809120c4b8 Bug/document linking (#688)
* feat: enhance supplier invoice payment process and settings handling

- Implemented linking of invoice documents to journal entries for cash payments in the supplier invoice payment process.
- Refactored settings fetching logic to improve loading states and error handling across various settings components.
- Introduced a new SettingsLoadError component to handle cases where settings fetch fails or returns no data.
- Updated useSettings hook to manage loading and error states more effectively, allowing for retries on failure.
- Enhanced tests for supplier invoice creation to ensure document IDs are persisted correctly for cash method payments.

* feat(salary): enable monthly salary edits in draft runs and handle zero-total declarations
2026-06-08 07:37:24 +02:00

25 lines
905 B
TypeScript

'use client'
import { useTranslations } from 'next-intl'
import { AlertCircle } from 'lucide-react'
import { Button } from '@/components/ui/button'
/**
* Shown when a settings section's fetch settled without a row (or errored).
* Replaces the old behaviour where a null `settings` object left the loading
* skeleton on screen indefinitely — a settled fetch always resolves to either
* content or this retryable state.
*/
export function SettingsLoadError({ onRetry }: { onRetry: () => void }) {
const t = useTranslations('common')
return (
<div className="flex flex-col items-center justify-center gap-4 py-12 text-center">
<AlertCircle className="h-8 w-8 text-muted-foreground" aria-hidden />
<p className="text-sm text-muted-foreground">{t('load_error')}</p>
<Button variant="outline" size="sm" onClick={onRetry}>
{t('retry')}
</Button>
</div>
)
}