@@ -53,10 +53,12 @@ const { data: likes, refresh: refreshLikes } = useFetch(() => `/api/social/likes
5353const { stars, refresh : refreshRepoMeta } = useRepoMeta (repositoryUrl )
5454
5555const formattedStars = computed (() =>
56- Intl .NumberFormat (' en' , {
57- notation: ' compact' ,
58- maximumFractionDigits: 1 ,
59- }).format (stars .value ),
56+ stars .value > 0
57+ ? Intl .NumberFormat (' en' , {
58+ notation: ' compact' ,
59+ maximumFractionDigits: 1 ,
60+ }).format (stars .value )
61+ : ' ' ,
6062)
6163
6264try {
7577 class =" h-full w-full flex flex-col justify-center px-20 bg-[#050505] text-[#fafafa] relative overflow-hidden"
7678 >
7779 <div class =" relative z-10 flex flex-col gap-6" >
80+ <!-- Package name -->
7881 <div class =" flex items-start gap-4" >
7982 <div
8083 class =" flex items-center justify-center w-16 h-16 p-4 rounded-xl shadow-lg bg-gradient-to-tr from-[#3b82f6]"
@@ -107,6 +110,7 @@ try {
107110 </h1 >
108111 </div >
109112
113+ <!-- Version -->
110114 <div
111115 class =" flex items-center gap-5 text-4xl font-light text-[#a3a3a3]"
112116 style =" font-family : ' Geist Sans' , sans-serif "
@@ -122,6 +126,8 @@ try {
122126 >
123127 {{ resolvedVersion }}
124128 </span >
129+
130+ <!-- Downloads (if any) -->
125131 <span v-if =" downloads" class =" flex items-center gap-2" >
126132 <svg
127133 width =" 30"
@@ -139,7 +145,9 @@ try {
139145 </svg >
140146 <span >{{ $n(downloads.downloads) }}/wk</span >
141147 </span >
142- <span v-if =" pkg?.license" class =" flex items-center gap-2" >
148+
149+ <!-- License (if any) -->
150+ <span v-if =" pkg?.license" class =" flex items-center gap-2" data-testid =" license" >
143151 <svg
144152 viewBox =" 0 0 32 32"
145153 :fill =" primaryColor"
@@ -162,7 +170,9 @@ try {
162170 {{ pkg.license }}
163171 </span >
164172 </span >
165- <span class =" flex items-center gap-2" >
173+
174+ <!-- Stars (if any) -->
175+ <span v-if =" formattedStars" class =" flex items-center gap-2" data-testid =" stars" >
166176 <svg
167177 xmlns =" http://www.w3.org/2000/svg"
168178 viewBox =" 0 0 32 32"
@@ -179,7 +189,9 @@ try {
179189 {{ formattedStars }}
180190 </span >
181191 </span >
182- <span class =" flex items-center gap-2" >
192+
193+ <!-- Likes (if any) -->
194+ <span v-if =" likes.totalLikes > 0" class =" flex items-center gap-2" data-testid =" likes" >
183195 <svg
184196 width =" 32"
185197 height =" 32"
0 commit comments