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

fix(tools): visual tweaks to tools page

Browse files
Files changed (1) hide show
  1. src/routes/tools/+page.svelte +14 -6
src/routes/tools/+page.svelte CHANGED
@@ -224,20 +224,21 @@
224
 
225
  <div class="mt-8 grid grid-cols-1 gap-3 sm:gap-5 lg:grid-cols-2">
226
  {#each tools as tool}
 
227
  <a
228
  href="{base}/tools/{tool._id.toString()}"
229
  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"
 
230
  >
231
  <ToolLogo color={tool.color} icon={tool.icon} />
232
- <div class="flex w-full flex-col items-start text-left">
233
  <span class="font-bold">
234
  <span class="w-full overflow-clip">
235
  {tool.displayName}
236
  </span>
237
- {#if ($page.data.settings?.tools ?? []).includes(tool._id.toString())}
238
- <!-- active badge -->
239
  <span
240
- class="inline-flex items-center rounded-full bg-blue-800 px-2 py-0.5 text-xs font-semibold text-white"
241
  >Active</span
242
  >
243
  {/if}
@@ -245,8 +246,13 @@
245
  <span class="font-mono text-xs text-gray-400">
246
  {tool.baseUrl ?? "Internal tool"}
247
  </span>
 
 
 
 
 
248
  {#if tool.createdByName}
249
- <p class=" pt-2 text-xs text-gray-400 dark:text-gray-500">
250
  Added by <a
251
  class="hover:underline"
252
  href="{base}/tools?user={tool.createdByName}"
@@ -258,7 +264,9 @@
258
  {tool.useCount} runs
259
  </p>
260
  {:else}
261
- <p class="pt-2 text-xs text-gray-400 dark:text-gray-500">HuggingChat official tool</p>
 
 
262
  {/if}
263
  </div>
264
  </a>
 
224
 
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"
231
+ class:!border-blue-800={isActive}
232
  >
233
  <ToolLogo color={tool.color} icon={tool.icon} />
234
+ <div class="flex h-full w-full flex-col items-start py-2 text-left">
235
  <span class="font-bold">
236
  <span class="w-full overflow-clip">
237
  {tool.displayName}
238
  </span>
239
+ {#if isActive}
 
240
  <span
241
+ class="mx-1.5 inline-flex items-center rounded-full bg-blue-800 px-2 py-0.5 text-xs font-semibold text-white"
242
  >Active</span
243
  >
244
  {/if}
 
246
  <span class="font-mono text-xs text-gray-400">
247
  {tool.baseUrl ?? "Internal tool"}
248
  </span>
249
+
250
+ <p class=" line-clamp-1 w-full text-sm text-gray-600 dark:text-gray-300">
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"
258
  href="{base}/tools?user={tool.createdByName}"
 
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}
271
  </div>
272
  </a>