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

100% Statements 15/15
75% Branches 3/4
100% Functions 6/6
100% Lines 14/14

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  4x   1x     4x 5x   1x   1x 1x             5x               4x 4x   4x 4x 5x 5x                        
<template>
    <section class="bg-muted">
        <UContainer class="flex flex-col gap-16 py-20">
            <h2 class="font-display text-section text-highlighted">
                {{ $t("agenticWorkflows.projects.title") }}
                <mark>{{ $t("agenticWorkflows.projects.titleMark") }}</mark>
            </h2>
            <article v-for="item in maps" :key="item.id" class="flex flex-col gap-5">
                <div
                    class="flex flex-col gap-2 border-t border-accented pt-6 md:flex-row md:items-baseline md:justify-between"
                >
                    <h3 class="font-display text-heading text-highlighted">{{ item.title }}</h3>
                    <p class="font-mono text-sm text-muted">{{ item.counts }}</p>
                </div>
                <WorkflowProjectMap :map="item.map" :label="item.label" />
                <ULink
                    :to="portalUrl(`/workflows/${item.id}`)"
                    class="self-start text-primary underline underline-offset-4"
                >
                    {{ $t("agenticWorkflows.projects.open") }} →
                </ULink>
            </article>
        </UContainer>
    </section>
</template>
 
<script setup lang="ts">
const { t } = useI18n();
const { data: projects } = await useWorkflowMaps();
 
const maps = computed(() =>
    projects.value.map(({ id, title, map }) => {
        const blocks = t("agenticWorkflows.projects.blocks", map.blocks);
        return {
            id,
            title,
            label: t("agenticWorkflows.projects.mapLabel", { title }),
            map,
            counts: map.tickets
                ? t("agenticWorkflows.projects.tickets", { blocks, ...map.tickets })
                : blocks,
        };
    }),
);
</script>