@@ -49,6 +49,16 @@ const resultsPackages = computed(() => {
4949 return packages .value .filter (p => p .includes (query .value ))
5050})
5151
52+ function getLogo(packageName : string ): string {
53+ const logo = pkg .value ! .find (p => p .name === packageName )?.title
54+ return ` https://unjs.io/assets/logos/${logo }.svg `
55+ }
56+
57+ function getGitHubLink(packageName : string ): string {
58+ const repoName = pkg .value ! .find (p => p .name === packageName )?.title
59+ return ` https//github.com/unjs/${repoName } `
60+ }
61+
5262function resetSelection() {
5363 selectedPackages .value = []
5464}
@@ -105,7 +115,7 @@ const lessXl = breakpoints.smaller('xl')
105115 <ComboboxOption v-for =" item in resultsPackages" :key =" item" v-slot =" { active, selected }" as =" template" :value =" item" >
106116 <li class =" cursor-pointer px-1 py-1 w-full flex items-center justify-between rounded-md transition ease-in" :class =" { 'bg-gray-300/40': active }" >
107117 <span class =" flex items-center gap-2" >
108- <UAvatar :src =" `https://unjs.io/assets/logos/${ item}.svg` " :alt =" `Logo of ${item}`" size =" xs" :ui =" { rounded: '' }" />
118+ <UAvatar :src =" getLogo( item) " :alt =" `Logo of ${item}`" size =" xs" :ui =" { rounded: '' }" />
109119 <span >
110120 {{ item }}
111121 </span >
@@ -179,7 +189,7 @@ const lessXl = breakpoints.smaller('xl')
179189 {{ slideOverPackage?.name }}
180190 </h2 >
181191
182- <UButton icon =" i-simple-icons-github" label =" View on GitHub" :to =" `https://github.com/unjs/${slideOverPackage.name }`" target =" _blank" variant =" ghost" color =" gray" />
192+ <UButton icon =" i-simple-icons-github" label =" View on GitHub" :to =" `https://github.com/unjs/${slideOverPackage.title }`" target =" _blank" variant =" ghost" color =" gray" />
183193 </template >
184194
185195 <div class =" prose" >
@@ -200,7 +210,7 @@ const lessXl = breakpoints.smaller('xl')
200210 <UTooltip text =" View relations" >
201211 <UButton icon =" i-ph-graph" variant =" ghost" color =" gray" @click =" openInRelations(dep)" />
202212 </UTooltip >
203- <UButton icon =" i-simple-icons-github" :to =" `https://github.com/unjs/${ dep}` " target =" _blank" variant =" ghost" color =" gray" />
213+ <UButton icon =" i-simple-icons-github" :to =" getGitHubLink( dep) " target =" _blank" variant =" ghost" color =" gray" />
204214 </span >
205215 </span >
206216 </li >
@@ -224,7 +234,7 @@ const lessXl = breakpoints.smaller('xl')
224234 <UTooltip text =" View relations" >
225235 <UButton icon =" i-ph-graph" variant =" ghost" color =" gray" @click =" openInRelations(dep)" />
226236 </UTooltip >
227- <UButton icon =" i-simple-icons-github" :to =" `https://github.com/unjs/${ dep}` " target =" _blank" variant =" ghost" color =" gray" />
237+ <UButton icon =" i-simple-icons-github" :to =" getGitHubLink( dep) " target =" _blank" variant =" ghost" color =" gray" />
228238 </span >
229239 </span >
230240 </li >
0 commit comments