nsarrazin HF Staff commited on
Commit
03cf845
·
1 Parent(s): d433b55

feat(settings): add button to quick remove assistants

Browse files
src/routes/settings/(nav)/+layout.svelte CHANGED
@@ -157,6 +157,32 @@
157
  Active
158
  </div>
159
  {/if}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  </a>
161
  {/each}
162
  <a
 
157
  Active
158
  </div>
159
  {/if}
160
+ <button
161
+ type="submit"
162
+ form={`unsubscribe-${assistant._id}`}
163
+ aria-label="Remove assistant from your list"
164
+ class={[
165
+ "rounded-full p-1 text-xs hover:bg-gray-500 hover:bg-opacity-20",
166
+ assistant._id.toString() === page.params.assistantId
167
+ ? "block"
168
+ : "hidden group-hover:block",
169
+ assistant._id.toString() !== $settings.activeModel && "ml-auto",
170
+ ]}
171
+ onclick={(event) => {
172
+ if (assistant._id.toString() === page.params.assistantId) {
173
+ goto(`${base}/settings`);
174
+ }
175
+ event.stopPropagation();
176
+ }}
177
+ >
178
+ <CarbonClose class="size-4 text-gray-500" />
179
+ </button>
180
+ <form
181
+ id={`unsubscribe-${assistant._id}`}
182
+ action="{base}/settings/assistants/{assistant._id.toString()}?/unsubscribe"
183
+ method="POST"
184
+ class="hidden"
185
+ ></form>
186
  </a>
187
  {/each}
188
  <a