All files / apps/portfolio/app/components DecisionQuestions.vue

100% Statements 4/4
87.5% Branches 7/8
100% Functions 2/2
100% Lines 3/3

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  12x 40x                     40x                                        
<template>
    <ul class="flex flex-col">
        <li v-for="item in items" :key="item.id">
            <ULink
                :to="portalUrl(`/decisions/${item.id}`)"
                class="group grid gap-2 border-t border-default"
                :class="split ? 'py-6 md:grid-cols-12' : 'py-5'"
            >
                <span
                    class="font-display text-2xl text-highlighted group-hover:text-primary"
                    :class="split && 'md:col-span-6'"
                >
                    {{ item.question }}
                </span>
                <span class="max-w-xl text-base text-muted" :class="split && 'md:col-span-6'">
                    {{ item.answer }}
                </span>
            </ULink>
        </li>
    </ul>
</template>
 
<script setup lang="ts">
import type { DecisionQuestion } from "~/types/DecisionQuestion";
 
interface Props {
    items: readonly DecisionQuestion[];
    /** Question and answer side by side from `md` up, for a full-width list. */
    split?: boolean;
}
 
const { items, split = false } = defineProps<Props>();
</script>