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

100% Statements 9/9
100% Branches 3/3
100% Functions 4/4
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 40 41 42 43 44 45 46 47 48 49 50 51 52  4x                 4x                   4x   4x           4x                 3x                            
<template>
    <div class="p-12 text-center">
        <UIcon :name="icon" class="mx-auto mb-2 size-8 text-dimmed" />
        <I18nT
            :keypath="collected ? 'collectionEmpty.nothingCollected' : 'collectionEmpty.nothing'"
            tag="p"
            scope="global"
            class="text-sm text-muted"
        >
            <template #folder>
                <code class="font-mono">{{ folder }}</code>
            </template>
        </I18nT>
        <I18nT
            keypath="collectionEmpty.writes"
            tag="p"
            scope="global"
            class="mt-1 text-xs text-dimmed"
        >
            <template #skill>
                <code class="font-mono">{{ skill }}</code>
            </template>
            <template #each>{{ each }}</template>
            <template #collect>
                <I18nT v-if="collected" keypath="collectionEmpty.collect" scope="global">
                    <template #command>
                        <code class="font-mono">{{ COLLECT }}</code>
                    </template>
                </I18nT>
            </template>
        </I18nT>
    </div>
</template>
 
<script setup lang="ts">
const { icon, folder, skill, each, collected = true } = defineProps<Props>();
 
const COLLECT = "pnpm exec nx collect @joinery/developer-portal";
 
interface Props {
    icon: string;
    /** The folder the records live in, such as `docs/audits/`. */
    folder: string;
    /** The skill that writes the records. */
    skill: string;
    /** How the records are filed, such as "them, one dated file per audit". */
    each: string;
    /** False for records read straight from the content collection, which no collect step reads. */
    collected?: boolean;
}
</script>