All files / apps/huella-legal/layers/publish/app/components PublishFaq.vue

100% Statements 8/8
100% Branches 0/0
100% Functions 2/2
100% Lines 7/7

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  2x                                         2x   2x 2x   2x   2x 10x              
<template>
    <section :aria-labelledby="headingId" class="border-t-2 border-inverted pt-4">
        <h2 :id="headingId" class="font-serif text-h3 text-highlighted">
            {{ $t("publish.faq.title") }}
        </h2>
        <UAccordion :items :default-value="QUESTIONS[0]" :unmount-on-hide="false" class="mt-2" />
        <UButton
            variant="link"
            color="neutral"
            :label="$t('publish.faq.guide')"
            icon="i-lucide-file-text"
            trailing-icon="i-lucide-arrow-right"
            :to="nav.publishGuide"
            :ui="{ label: 'overflow-visible whitespace-normal' }"
            class="mt-2 -ml-3"
        />
    </section>
</template>
 
<script setup lang="ts">
import type { AccordionItem } from "@nuxt/ui";
 
const QUESTIONS = ["length", "topics", "format", "changes", "advertising"] as const;
 
const { t } = useI18n();
const { nav } = useAppConfig();
 
const headingId = useId();
 
const items = computed<AccordionItem[]>(() =>
    QUESTIONS.map((key) => ({
        value: key,
        label: t(`publish.faq.items.${key}.question`),
        content: t(`publish.faq.items.${key}.answer`),
    })),
);
</script>