{#if attachments.length > 0}
{#each attachments as attachment} {@const isPending = 'pending' in attachment && attachment.pending} {@const imgSrc = isPending ? attachment.path : `/api/notes/${noteId}/attachments?attachmentId=${attachment.id}`}
{attachment.filename} { lightboxSrc = imgSrc; lightboxAlt = attachment.filename; }} data-testid="attachment-thumbnail" /> {#if isPending}
{:else if onToggleFeatured} {/if}
{/each}
{/if} {#if showDropZone}
{#if optimizing}

Optimizing...

{:else if uploading}

Uploading...

{:else} {/if}
{/if}
{#if lightboxSrc} lightboxSrc = null} /> {/if}