feat(#145): add DashboardNeedsMetadata widget component
Shows documents with missing metadata as a dashboard widget with links to the enrich workflow. Renders nothing when the list is empty. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
38
frontend/src/lib/components/DashboardNeedsMetadata.svelte
Normal file
38
frontend/src/lib/components/DashboardNeedsMetadata.svelte
Normal file
@@ -0,0 +1,38 @@
|
||||
<script lang="ts">
|
||||
type IncompleteDocumentDTO = {
|
||||
id: string;
|
||||
title: string;
|
||||
};
|
||||
|
||||
interface Props {
|
||||
incompleteDocs: IncompleteDocumentDTO[];
|
||||
}
|
||||
|
||||
let { incompleteDocs }: Props = $props();
|
||||
</script>
|
||||
|
||||
{#if incompleteDocs.length > 0}
|
||||
<div
|
||||
data-testid="dashboard-needs-metadata"
|
||||
class="border-brand-sand rounded-sm border bg-white p-6"
|
||||
>
|
||||
<h2 class="mb-4 font-sans text-xs font-bold tracking-widest text-gray-400 uppercase">
|
||||
Metadaten fehlen
|
||||
</h2>
|
||||
{#each incompleteDocs as doc (doc.id)}
|
||||
<div class="border-brand-sand flex items-center border-b py-2 last:border-0">
|
||||
<a
|
||||
href="/enrich/{doc.id}"
|
||||
class="font-serif text-sm text-ink hover:text-brand-navy hover:underline"
|
||||
>
|
||||
{doc.title}
|
||||
</a>
|
||||
</div>
|
||||
{/each}
|
||||
<div class="mt-4">
|
||||
<a href="/enrich" class="font-sans text-xs text-brand-navy/60 hover:text-brand-navy">
|
||||
Alle anzeigen
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
Reference in New Issue
Block a user