Skip to content

Commit 0e08f38

Browse files
committed
chore: health badge makeover
1 parent 4f7b1e7 commit 0e08f38

3 files changed

Lines changed: 26 additions & 38 deletions

File tree

app/components/module/ModuleHealthBadge.vue

Lines changed: 0 additions & 33 deletions
This file was deleted.

app/components/module/ModuleItem.vue

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,22 @@ const items = computed(() => [
165165
<span class="text-sm font-medium whitespace-normal">{{ formatNumber(module.stats.stars || 0) }}</span>
166166
</NuxtLink>
167167
</UTooltip>
168+
169+
<template v-if="module.health">
170+
<UTooltip :text="`Health: ${module.health.status} - ${module.health.score}/100`">
171+
<NuxtLink
172+
:to="`https://nuxt.care/?search=npm:${module.npm}`"
173+
class="flex items-center gap-1 hover:text-highlighted"
174+
target="_blank"
175+
>
176+
<UIcon name="i-lucide-heart-pulse" class="size-4 shrink-0" :style="{ color: module.health.color }" />
177+
<span class="text-sm font-medium whitespace-normal">
178+
{{ module.health.score }}
179+
</span>
180+
</NuxtLink>
181+
</UTooltip>
182+
</template>
183+
168184
<UTooltip v-if="selectedSort.key === 'publishedAt'" :text="`Updated ${formatDateByLocale('en', module.stats.publishedAt)}`">
169185
<NuxtLink
170186
class="flex items-center gap-1 hover:text-highlighted"

app/pages/modules/[slug].vue

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,16 @@ defineOgImageComponent('Module', {
153153

154154
<template v-if="module.health">
155155
<span class="hidden lg:block text-muted">&bull;</span>
156-
157-
<ModuleHealthBadge
158-
:health="module.health"
159-
:npm="module.npm"
160-
/>
156+
<UTooltip :text="`Health: ${module.health.status} - ${module.health.score}/100`">
157+
<NuxtLink
158+
:to="`https://nuxt.care/?search=npm:${module.npm}`"
159+
class="flex items-center gap-1.5"
160+
target="_blank"
161+
>
162+
<UIcon name="i-lucide-heart-pulse" class="size-5 shrink-0" :style="{ color: module.health.color }" />
163+
<span class="text-sm font-medium">{{ module.health.score }}</span>
164+
</NuxtLink>
165+
</UTooltip>
161166
</template>
162167

163168
<div class="mx-3 h-6 border-l border-gray-200 dark:border-gray-800 w-px hidden lg:block" />

0 commit comments

Comments
 (0)