All files / apps/huella-legal/layers/archive/app/components/subjects Grid.vue

100% Statements 6/6
100% Branches 1/1
100% Functions 3/3
100% Lines 6/6

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  3x     3x 2x 6x         2x             6x                                  
<template>
    <UContainer as="section" aria-labelledby="areas" class="py-16 lg:py-20">
        <h2 id="areas" class="scroll-mt-6 text-kicker">
            {{ $t("subjectsGrid.title") }}
        </h2>
        <ol class="mt-4 -mb-10 grid gap-x-10 sm:grid-cols-2 lg:grid-cols-3">
            <li
                v-for="{ value, count } in subjects"
                :key="value.id"
                class="group relative flex flex-col gap-2 border-t border-default pt-5 pb-10"
            >
                <span class="font-sans text-meta text-muted tabular-nums">{{
                    $t("subjectsGrid.count", { count }, count)
                }}</span>
                <ULink
                    raw
                    :to="{ name: 'category', params: { slug: value.slug } }"
                    class="font-serif text-h3 text-highlighted underline-title group-hover:underline after:absolute after:inset-0 focus-visible:outline-none focus-visible:after:outline-2 focus-visible:after:outline-offset-2 focus-visible:after:outline-primary"
                    >{{ value.name }}</ULink
                >
                <p v-if="value.description" class="font-serif text-base/relaxed text-toned">
                    {{ value.description }}
                </p>
            </li>
        </ol>
    </UContainer>
</template>
 
<script setup lang="ts">
interface Props {
    subjects: Facet<Category>[];
}
 
defineProps<Props>();
</script>