All files / apps/huella-legal/layers/archive/app/components/home Theses.vue

100% Statements 10/10
83.33% Branches 5/6
100% Functions 6/6
100% Lines 9/9

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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67    3x               2x                       2x               1x 2x                       2x   1x               2x                     3x    
<template>
    <UPageSection
        v-if="articles.length"
        orientation="horizontal"
        :aria-labelledby="titleId"
        :description="$t('homeTheses.lead')"
        :ui="{ wrapper: 'lg:pt-4', footer: 'mt-4', links: '-ml-3' }"
        class="bg-inverted text-default surface-inverted"
    >
        <template #headline>
            <BaseKicker>{{ $t("homeTheses.kicker") }}</BaseKicker>
        </template>
        <template #title>
            <span :id="titleId">{{ $t("homeTheses.title") }}</span>
        </template>
        <template #links>
            <UButton
                variant="link"
                :label="$t('homeTheses.all')"
                trailing-icon="i-lucide-arrow-right"
                :to="{ name: 'publications', query: { format: 'tfg-tfm' } }"
                class="text-highlighted hover:text-highlighted"
            />
            <UButton
                variant="link"
                :label="$t('homeTheses.publish')"
                :to="{ name: 'publish', hash: '#tesis' }"
                class="text-huella-teal-200 hover:text-huella-teal-100"
            />
        </template>
        <ol class="grid gap-x-8 md:grid-cols-3 lg:col-span-8">
            <li
                v-for="article in articles"
                :key="article.id"
                class="relative border-t border-default py-5"
            >
                <p v-if="article.category" class="text-kicker text-secondary">
                    {{ article.category.name }}
                </p>
                <ULink
                    raw
                    :to="{ name: 'article', params: { slug: article.slug } }"
                    class="mt-2 block font-serif text-lg/snug text-highlighted underline-title after:absolute after:inset-0 hover:underline focus-visible:rounded-xs focus-visible:outline-offset-2 focus-visible:outline-ivory-50"
                    >{{ article.title }}</ULink
                >
                <p class="mt-2 font-sans text-meta text-muted">
                    <template v-if="article.authors[0]"
                        >{{ article.authors[0].name }}
                        <span aria-hidden="true">ยท</span>
                    </template>
                    {{ $t("homeTheses.readingTime", { minutes: article.readingMinutes }) }}
                </p>
            </li>
        </ol>
    </UPageSection>
</template>
 
<script setup lang="ts">
interface Props {
    articles: ArticleSummary[];
}
 
defineProps<Props>();
 
const titleId = useId();
</script>