+
+ {#await buckets}
+ loading
+ {:then response}
+ {#if currentBucket?.$id}
+
+ ({
+ value: n.$id,
+ label: n.name
+ }))}
+ bind:value={currentBucket.$id}
+ id="buckets" />
+
+ {/if}
+ {/await}
+
+ {#await buckets}
+
+ {:then response}
+ {#if response?.total}
+ {#if currentBucket}
+
+
+ {#if files}
+ {#await files}
+
+ {:then response}
+
+ {#if response?.files?.length}
+ {#if view === 'grid'}
+
+ {#each response?.files as file}
+ -
+
+
+ selectFile(file)}
+ on:keyup={clickOnEnter}
+ tabindex="0"
+ style:aspect-ratio="1/1"
+ style:display="flex"
+ style:align-items="flex-end"
+ style:flex-direction="row-reverse"
+ style:box-shadow="none"
+ class="card u-height-100-percent u-gap-16"
+ style="--card-padding:0.5rem;--card-padding-mobile:0.5rem; --card-border-radius:var(--border-radius-medium);">
+
+
+
{file.name}
+
+
+ {/each}
+
+ {/if}
+ {#if view === 'list'}
+
+
+ Filename
+
+ ID
+
+
+ Type
+
+
+ Size
+
+
+ Created
+
+
+
+ {#each response?.files as file}
+
+ selectFile(file)}>
+
+
+
+
+
+
+
+ {file.name}
+
+
+
+
+ {file.$id}
+
+
+ {file.mimeType}
+
+
+ {calculateSize(
+ file.sizeOriginal
+ )}
+
+
+ {toLocaleDate(
+ file.$createdAt
+ )}
+
+
+ {/each}
+
+
+ {/if}
+ {:else if $search}
+
+
+
+
+
Sorry we couldn't find "{$search}"
+
+ There are no files that match
+ your search.
+
+
+
+
+
+
+
+
+ {:else}
+
+
+
+
+ No files found within this bucket.
+
+
+ Need a hand? Learn more in our
+ documentation.
+
+
+
+
+ {/if}
+
+ {/await}
+ {/if}
+ {/if}
+ {:else}
+
+
+
+ No buckets found
+
+
+
+
+ {/if}
+ {/await}
+