All files / apps/huella-legal/layers/archive/app/components/directory Card.vue

100% Statements 9/9
100% Branches 0/0
100% Functions 3/3
100% Lines 8/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49  81x               1x                 1x       162x       1x             81x                     81x   81x    
<template>
    <UPageCard
        variant="outline"
        :description="author.bio"
        :to="{ name: 'author', params: { slug: author.slug } }"
        :ui="{ description: 'mt-4 line-clamp-3' }"
        class="group h-full"
    >
        <template #title>
            <span class="flex items-center gap-4">
                <UAvatar
                    :src="author.avatar?.url"
                    :text="authorInitials"
                    size="3xl"
                    aria-hidden="true"
                    class="size-14 shrink-0"
                />
                <h3
                    class="min-w-0 font-serif text-xl/snug font-normal text-balance underline-title group-hover:underline"
                >
                    {{ author.name }}
                </h3>
            </span>
        </template>
        <template #footer>
            <p
                class="flex items-center justify-between border-t border-muted pt-3 font-sans text-meta text-muted"
            >
                <span>{{ $t("directoryCard.count", { count }, count) }}</span>
                <UIcon
                    name="i-lucide-arrow-right"
                    class="size-4 text-dimmed transition-transform group-hover:translate-x-0.5"
                />
            </p>
        </template>
    </UPageCard>
</template>
 
<script setup lang="ts">
interface Props {
    author: Author;
    count: number;
}
 
const props = defineProps<Props>();
 
const authorInitials = computed<string>(() => initials(props.author.name));
</script>