Some checks failed
CI / Unit & Component Tests (pull_request) Failing after 2m39s
CI / OCR Service Tests (pull_request) Successful in 29s
CI / Backend Unit Tests (pull_request) Failing after 2m50s
CI / Unit & Component Tests (push) Failing after 2m31s
CI / OCR Service Tests (push) Successful in 31s
CI / Backend Unit Tests (push) Failing after 2m52s
Resolved 9 conflicts: - AuditLogQueryRepository/Service: keep HEAD (findRecentContributorsForDocuments) - ContributorStack: merge main key fix + text-[10px] with HEAD safeColor + aria - DashboardResumeStrip: merge main text-[10px] with HEAD safeColor - +page.server/svelte + tests: keep HEAD (pure dashboard, no isDashboard) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
50 lines
1.5 KiB
Svelte
50 lines
1.5 KiB
Svelte
<script lang="ts">
|
|
import type { components } from '$lib/generated/api';
|
|
|
|
type ActivityActorDTO = components['schemas']['ActivityActorDTO'];
|
|
|
|
interface Props {
|
|
contributors: ActivityActorDTO[];
|
|
hasMore: boolean;
|
|
}
|
|
|
|
let { contributors, hasMore }: Props = $props();
|
|
|
|
const safeContributors = $derived(contributors ?? []);
|
|
|
|
function safeColor(color: string): string {
|
|
return /^#[0-9a-fA-F]{6}$/.test(color) ? color : '#8c9aa3';
|
|
}
|
|
</script>
|
|
|
|
{#if safeContributors.length === 0}
|
|
<span
|
|
role="img"
|
|
aria-label="Noch niemand angefangen"
|
|
class="inline-block h-[22px] w-[22px] flex-shrink-0 rounded-full border-[1.5px] border-dashed border-[#cdcbbf]"
|
|
></span>
|
|
{:else}
|
|
<span class="inline-flex items-center">
|
|
{#each safeContributors as actor, i (actor.initials + '-' + actor.color)}
|
|
<span
|
|
role="img"
|
|
aria-label={actor.name ?? actor.initials}
|
|
class="inline-flex h-[22px] w-[22px] flex-shrink-0 items-center justify-center rounded-full font-sans text-[10px] font-bold text-white ring-2 ring-white {i > 0 ? '-ml-1.5' : ''}"
|
|
style="background-color: {safeColor(actor.color)};"
|
|
title={actor.name ?? actor.initials}
|
|
>
|
|
{actor.initials}
|
|
</span>
|
|
{/each}
|
|
{#if hasMore}
|
|
<span
|
|
role="img"
|
|
aria-label="Weitere Mitwirkende"
|
|
class="-ml-1.5 inline-flex h-[22px] w-[22px] flex-shrink-0 items-center justify-center rounded-full bg-[#e4e2d7] font-sans text-[10px] font-bold text-ink-3 ring-2 ring-white"
|
|
>
|
|
…
|
|
</span>
|
|
{/if}
|
|
</span>
|
|
{/if}
|