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

100% Statements 9/9
100% Branches 1/1
100% Functions 4/4
100% Lines 8/8

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  21x   3x   3x 3x   3x     22x       1x 22x                                
<template>
    <UCard variant="flush">
        <template #header>
            <div class="flex items-center justify-between gap-4">
                <div>
                    <h2 class="font-semibold">{{ title }}</h2>
                    <p class="text-xs text-muted">{{ note }}</p>
                </div>
                <span class="shrink-0 text-xs text-dimmed tabular-nums">
                    {{ $t("listCard.shown", { shown, total }) }}
                </span>
            </div>
        </template>
 
        <slot v-if="shown === 0" name="empty">
            <EmptyState>{{ $t("listCard.empty") }}</EmptyState>
        </slot>
        <div v-else class="divide-y divide-default"><slot /></div>
    </UCard>
</template>
 
<script setup lang="ts">
interface Props {
    title: string;
    note: string;
    /** How many rows the filter lets through. */
    shown: number;
    total: number;
}
 
const { title, note, shown, total } = defineProps<Props>();
</script>