{ loading = true; if (files?.[0] && files[0].size > 0 && compress) { await compress(files[0], { maxWidth: 500, maxHeight: 500, quality: 1, }).then((resizedImage) => { formData.set("avatar", resizedImage); }); } if (deleteExistingAvatar === true) { if (assistant?.avatar) { // if there is an avatar we explicitly removei t formData.set("avatar", "null"); } else { // else we just remove it from the input formData.delete("avatar"); } } return async ({ result }) => { loading = false; await applyAction(result); }; }} > {#if assistant}

Edit assistant ({assistant?.name ?? ""})

Modifying an existing assistant will propagate those changes to all users.

{:else}

Create new assistant

Assistants are public, and can be accessed by anyone with the link.

{/if}
Avatar {#if (files && files[0]) || (assistant?.avatar && !deleteExistingAvatar)}
{#if files && files[0]} avatar {:else if assistant?.avatar} avatar {/if}
{:else}

{getError("avatar", form)}

{/if}