All files / apps/developer-portal/app/components PageFacts.vue

100% Statements 7/7
100% Branches 5/5
100% Functions 2/2
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 37 38 39  33x 6x   139x 6x             2x                                               31x    
<template>
    <div class="mt-2 px-4 sm:px-6">
        <p class="text-xs text-muted">{{ provenance }}</p>
        <dl v-if="facts.length > 0" class="mt-4 flex flex-wrap gap-x-8 gap-y-4">
            <div v-for="fact in facts" :key="fact.label" class="flex flex-col gap-1">
                <dt class="text-xs text-muted first-letter:uppercase">
                    <button
                        v-if="fact.series"
                        type="button"
                        class="border-b border-dashed border-current hover:text-highlighted"
                        :class="fact.series === series && 'border-solid text-highlighted'"
                        :aria-pressed="fact.series === series"
                        @click="series = fact.series"
                    >
                        {{ fact.label }}
                    </button>
                    <template v-else>{{ fact.label }}</template>
                </dt>
                <dd data-figure class="text-3xl leading-none text-highlighted" :class="fact.class">
                    {{ fact.value }}
                </dd>
            </div>
        </dl>
    </div>
</template>
 
<script setup lang="ts">
import type { PageFact } from "~/types/PageFact";
 
interface Props {
    provenance: string;
    facts: PageFact[];
}
 
const { provenance, facts } = defineProps<Props>();
 
const series = defineModel<string>("series", { default: "" });
</script>