nsarrazin HF Staff commited on
Commit
3f9e008
·
unverified ·
1 Parent(s): 632d693

fix(tools): add official distinction

Browse files
Files changed (1) hide show
  1. src/routes/tools/+page.svelte +3 -2
src/routes/tools/+page.svelte CHANGED
@@ -225,6 +225,7 @@
225
  <div class="mt-8 grid grid-cols-1 gap-3 sm:gap-5 lg:grid-cols-2">
226
  {#each tools as tool}
227
  {@const isActive = ($page.data.settings?.tools ?? []).includes(tool._id.toString())}
 
228
  <a
229
  href="{base}/tools/{tool._id.toString()}"
230
  class="relative flex flex-row items-center gap-4 overflow-hidden text-balance rounded-xl border bg-gray-50/50 px-4 text-center shadow hover:bg-gray-50 hover:shadow-inner dark:border-gray-800/70 dark:bg-gray-950/20 dark:hover:bg-gray-950/40 max-sm:px-4 sm:h-24"
@@ -251,7 +252,7 @@
251
  {tool.description}
252
  </p>
253
 
254
- {#if tool.createdByName}
255
  <p class="mt-auto text-xs text-gray-400 dark:text-gray-500">
256
  Added by <a
257
  class="hover:underline"
@@ -264,7 +265,7 @@
264
  {tool.useCount} runs
265
  </p>
266
  {:else}
267
- <p class="mt-auto text-xs text-gray-400 dark:text-gray-500">
268
  HuggingChat official tool
269
  </p>
270
  {/if}
 
225
  <div class="mt-8 grid grid-cols-1 gap-3 sm:gap-5 lg:grid-cols-2">
226
  {#each tools as tool}
227
  {@const isActive = ($page.data.settings?.tools ?? []).includes(tool._id.toString())}
228
+ {@const isOfficial = !tool.createdByName}
229
  <a
230
  href="{base}/tools/{tool._id.toString()}"
231
  class="relative flex flex-row items-center gap-4 overflow-hidden text-balance rounded-xl border bg-gray-50/50 px-4 text-center shadow hover:bg-gray-50 hover:shadow-inner dark:border-gray-800/70 dark:bg-gray-950/20 dark:hover:bg-gray-950/40 max-sm:px-4 sm:h-24"
 
252
  {tool.description}
253
  </p>
254
 
255
+ {#if !isOfficial}
256
  <p class="mt-auto text-xs text-gray-400 dark:text-gray-500">
257
  Added by <a
258
  class="hover:underline"
 
265
  {tool.useCount} runs
266
  </p>
267
  {:else}
268
+ <p class="mt-auto text-xs text-purple-700 dark:text-purple-400">
269
  HuggingChat official tool
270
  </p>
271
  {/if}