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:
@@ -452,6 +452,7 @@
|
||||
"dashboard_reader_stats_persons": "Personen",
|
||||
"dashboard_reader_stats_stories": "Geschichten",
|
||||
"dashboard_reader_person_chips_heading": "Personen",
|
||||
"dashboard_reader_no_persons": "Noch keine Personen im Archiv.",
|
||||
"dashboard_reader_all_persons": "Alle Personen →",
|
||||
"dashboard_reader_drafts_heading": "Meine Entwürfe",
|
||||
"dashboard_reader_drafts_empty": "Keine Entwürfe",
|
||||
|
||||
@@ -452,6 +452,7 @@
|
||||
"dashboard_reader_stats_persons": "Persons",
|
||||
"dashboard_reader_stats_stories": "Stories",
|
||||
"dashboard_reader_person_chips_heading": "Persons",
|
||||
"dashboard_reader_no_persons": "No persons in the archive yet.",
|
||||
"dashboard_reader_all_persons": "All Persons →",
|
||||
"dashboard_reader_drafts_heading": "My Drafts",
|
||||
"dashboard_reader_drafts_empty": "No drafts",
|
||||
|
||||
@@ -452,6 +452,7 @@
|
||||
"dashboard_reader_stats_persons": "Personas",
|
||||
"dashboard_reader_stats_stories": "Historias",
|
||||
"dashboard_reader_person_chips_heading": "Personas",
|
||||
"dashboard_reader_no_persons": "Todavía no hay personas en el archivo.",
|
||||
"dashboard_reader_all_persons": "Todas las personas →",
|
||||
"dashboard_reader_drafts_heading": "Mis borradores",
|
||||
"dashboard_reader_drafts_empty": "Sin borradores",
|
||||
|
||||
@@ -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