feat(dashboard): empty-state message for ReaderPersonChips
When the top-persons fetch returns an empty list (or fails and degrades to []), the chip area used to render the heading and the view-all link with nothing in between, looking like a load failure. Adds dashboard_reader_no_persons (de/en/es) and renders it above the chip row. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -31,6 +31,9 @@ const { persons }: Props = $props();
|
||||
<h2 class="text-xs font-bold tracking-widest text-ink-3 uppercase">
|
||||
{m.dashboard_reader_person_chips_heading()}
|
||||
</h2>
|
||||
{#if persons.length === 0}
|
||||
<p class="font-sans text-sm text-ink-3">{m.dashboard_reader_no_persons()}</p>
|
||||
{/if}
|
||||
<div class="flex flex-wrap gap-2">
|
||||
{#each persons as p (p.id)}
|
||||
<a
|
||||
|
||||
@@ -78,4 +78,10 @@ describe('ReaderPersonChips', () => {
|
||||
const chips = page.getByRole('link', { name: /Müller|Schmidt/ });
|
||||
await expect.element(chips).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders an empty-state message when persons array is empty', async () => {
|
||||
render(ReaderPersonChips, { persons: [] });
|
||||
const message = page.getByText(/Noch keine Personen im Archiv/i);
|
||||
await expect.element(message).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user