extonlawrence commited on
Commit
2aa62b9
·
1 Parent(s): 29fe8bf

Add personas navigation link with dynamic count to sidebar menu

Browse files
Files changed (1) hide show
  1. src/lib/components/NavMenu.svelte +14 -0
src/lib/components/NavMenu.svelte CHANGED
@@ -27,9 +27,11 @@
27
  import { browser } from "$app/environment";
28
  import { usePublicConfig } from "$lib/utils/PublicConfig.svelte";
29
  import { useAPIClient, handleResponse } from "$lib/APIClient";
 
30
 
31
  const publicConfig = usePublicConfig();
32
  const client = useAPIClient();
 
33
 
34
  interface Props {
35
  conversations: ConvSidebar[];
@@ -72,6 +74,7 @@
72
  });
73
 
74
  const nModels: number = page.data.models.filter((el: Model) => !el.unlisted).length;
 
75
 
76
  async function handleVisible() {
77
  p++;
@@ -187,6 +190,17 @@
187
  >
188
  </a>
189
 
 
 
 
 
 
 
 
 
 
 
 
190
  <span class="flex gap-1">
191
  <a
192
  href="{base}/settings"
 
27
  import { browser } from "$app/environment";
28
  import { usePublicConfig } from "$lib/utils/PublicConfig.svelte";
29
  import { useAPIClient, handleResponse } from "$lib/APIClient";
30
+ import { useSettingsStore } from "$lib/stores/settings";
31
 
32
  const publicConfig = usePublicConfig();
33
  const client = useAPIClient();
34
+ const settings = useSettingsStore();
35
 
36
  interface Props {
37
  conversations: ConvSidebar[];
 
74
  });
75
 
76
  const nModels: number = page.data.models.filter((el: Model) => !el.unlisted).length;
77
+ let nPersonas = $derived($settings.personas.length);
78
 
79
  async function handleVisible() {
80
  p++;
 
190
  >
191
  </a>
192
 
193
+ <a
194
+ href="{base}/personas"
195
+ class="flex h-9 flex-none items-center gap-1.5 rounded-lg pl-2.5 pr-2 text-gray-500 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-700"
196
+ >
197
+ Personas
198
+ <span
199
+ class="ml-auto rounded-md bg-gray-500/5 px-1.5 py-0.5 text-xs text-gray-400 dark:bg-gray-500/20 dark:text-gray-400"
200
+ >{nPersonas}</span
201
+ >
202
+ </a>
203
+
204
  <span class="flex gap-1">
205
  <a
206
  href="{base}/settings"