All files / apps/developer-portal/layers/benchmarks/app/components BenchmarksMeta.vue

100% Statements 6/6
100% Branches 7/7
100% Functions 2/2
100% Lines 5/5

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                            2x                           6x   6x 6x             6x    
<template>
    <StatusPill v-if="verdict" :label="verdict.label" :tone="verdict.tone" />
    <span v-if="kind" class="text-xs text-muted">{{ kind }}</span>
    <UButton
        v-if="benchmark?.url"
        :to="benchmark.url"
        :label="$t('benchmarksMeta.open')"
        icon="i-lucide-external-link"
        color="neutral"
        variant="ghost"
        size="xs"
        target="_blank"
        external
    />
    <code class="font-mono text-xs text-dimmed">{{ source }}</code>
</template>
 
<script setup lang="ts">
import type { Benchmark } from "#layers/benchmarks/app/types/Benchmark.ts";
 
interface Props {
    benchmark: Benchmark | null;
    /** The repo path of the entry's markdown file. */
    source: string;
}
 
const { benchmark, source } = defineProps<Props>();
 
const { t } = useI18n();
 
const verdict = computed(() =>
    benchmark?.verdict
        ? {
              label: t(`benchmarks.verdict.${benchmark.verdict}`),
              tone: benchmarkVerdictTone(benchmark.verdict),
          }
        : null,
);
const kind = computed(() => (benchmark?.kind ? benchmarkKindLabel(benchmark.kind) : null));
</script>