diff --git a/src/lib/components/git/repositories.svelte b/src/lib/components/git/repositories.svelte index 33679078b..07f1f51ec 100644 --- a/src/lib/components/git/repositories.svelte +++ b/src/lib/components/git/repositories.svelte @@ -173,84 +173,90 @@ {:then response} {#if response?.length} - - - {#each paginatedItems as repo} - - - - {#if action === 'select'} - repository.set(repo)} - value={repo.id} /> - {/if} - {#if product === 'sites'} - {#if repo?.framework && repo.framework !== 'other'} - - - - {:else} - - {/if} - {:else} - {@const iconName = repo?.runtime - ? repo.runtime.split('-')[0] - : undefined} - - - - {/if} + + {#snippet children(paginatedItems)} + + {#each paginatedItems as repo} + + - - {repo.name} - - {#if repo.private} - + alignItems="center" + gap="s"> + {#if action === 'select'} + repository.set(repo)} + value={repo.id} /> {/if} - - - {#if action === 'button'} - - + + + {:else} + + {/if} + {:else} + {@const iconName = repo?.runtime + ? repo.runtime.split('-')[0] + : undefined} + connect(repo)}> - Connect - + alt={repo.name} + empty={!iconName}> + + + {/if} + + + {repo.name} + + {#if repo.private} + + {/if} + - {/if} - - - - {/each} - + {#if action === 'button'} + + connect(repo)}> + Connect + + + {/if} + + + + {/each} + + {/snippet} {:else} diff --git a/src/lib/components/paginator.svelte b/src/lib/components/paginator.svelte index 7b5c6cb50..113be0097 100644 --- a/src/lib/components/paginator.svelte +++ b/src/lib/components/paginator.svelte @@ -9,7 +9,8 @@ hideFooter = false, hidePages = true, hasLimit = false, - name = 'items' + name = 'items', + children } = $props(); let total = $derived(items.length); @@ -20,7 +21,7 @@ - + {@render children(paginatedItems, limit)} {#if !hideFooter} diff --git a/src/routes/(console)/organization-[organization]/usage/[[invoice]]/totalMembers.svelte b/src/routes/(console)/organization-[organization]/usage/[[invoice]]/totalMembers.svelte index e74b0c2ac..0d688edc7 100644 --- a/src/routes/(console)/organization-[organization]/usage/[[invoice]]/totalMembers.svelte +++ b/src/routes/(console)/organization-[organization]/usage/[[invoice]]/totalMembers.svelte @@ -52,37 +52,38 @@ - - - - Members - Joined - - {#each paginatedItems as member} - - - - - - - {member.userName ? member.userName : member.userEmail} - + + {#snippet children(paginatedItems: typeof members.memberships)} + + + Members + Joined + + {#each paginatedItems as member} + + + + + + + {member.userName + ? member.userName + : member.userEmail} + + - - - - - - - {/each} - + + + + + + {/each} + + {/snippet} {:else} diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/relationshipsModal.svelte b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/relationshipsModal.svelte index 49bf2b4ac..c09462ccb 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/relationshipsModal.svelte +++ b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/relationshipsModal.svelte @@ -27,34 +27,36 @@ {#if data?.length} - - ({ id }))]}> - - Document ID - {#if args?.length} - {#each args as arg} - {arg} - {/each} - {/if} - - {#each paginatedItems as doc} - (show = false)}> - - {doc.$id} - + + {#snippet children(paginatedItems: typeof data)} + ({ id }))]}> + + Document ID {#if args?.length} {#each args as arg} - {doc[arg]} + {arg} {/each} {/if} - - {/each} - + + {#each paginatedItems as doc} + (show = false)}> + + {doc.$id} + + {#if args?.length} + {#each args as arg} + {doc[arg]} + {/each} + {/if} + + {/each} + + {/snippet} {/if} diff --git a/src/routes/(console)/project-[project]/functions/templates/+page.svelte b/src/routes/(console)/project-[project]/functions/templates/+page.svelte index 007ae8d56..4d7a3053c 100644 --- a/src/routes/(console)/project-[project]/functions/templates/+page.svelte +++ b/src/routes/(console)/project-[project]/functions/templates/+page.svelte @@ -82,7 +82,7 @@ - + @@ -140,86 +140,88 @@ {#if data.templates?.length > 0} - - - {#each paginatedItems as template} - {@const baseRuntimes = getBaseRuntimes(template.runtimes)} - {@const displayed = baseRuntimes.slice(0, 2)} - {@const hidden = baseRuntimes.slice(1, -1)} - - - - - {template.name} - - - - {template.tagline} - - - + + {#snippet children(paginatedItems: typeof data.templates)} + + {#each paginatedItems as template} + {@const baseRuntimes = getBaseRuntimes(template.runtimes)} + {@const displayed = baseRuntimes.slice(0, 2)} + {@const hidden = baseRuntimes.slice(1, -1)} + - - {#each displayed as runtime} - {@const icon = getIconFromRuntime(runtime.name)} - {#if icon} - - - - {/if} - {/each} - {#if hidden.length} - - - - +{hidden.length} - - - - {hidden.map((n) => n.name).join(', ')} - - - {/if} - + gap="xl"> + + + {template.name} + + + + {template.tagline} + + + - - {#if $canWriteFunctions} - - {/if} + justifyContent="space-between" + alignItems="center"> + + {#each displayed as runtime} + {@const icon = getIconFromRuntime(runtime.name)} + {#if icon} + + + + {/if} + {/each} + {#if hidden.length} + + + + +{hidden.length} + + + + {hidden.map((n) => n.name).join(', ')} + + + {/if} + + + + {#if $canWriteFunctions} + + {/if} + - - - {/each} - + + {/each} + + {/snippet} {:else if data?.search} diff --git a/src/routes/(console)/project-[project]/sites/create-site/configuration.svelte b/src/routes/(console)/project-[project]/sites/create-site/configuration.svelte index 735a99a6a..88b5dba51 100644 --- a/src/routes/(console)/project-[project]/sites/create-site/configuration.svelte +++ b/src/routes/(console)/project-[project]/sites/create-site/configuration.svelte @@ -180,114 +180,118 @@ - - - Key - Value - - - {#each paginatedItems as variable} - - {variable.key} - - -
- {#if variable.secret} - - - - This value is secret, you cannot see - its value. + {#snippet children(paginatedItems: typeof variables)} + + + Key + Value + + + {#each paginatedItems as variable} + + {variable.key} + + +
+ {#if variable.secret} + + + + This value is secret, you cannot + see its value. + + + {:else} + + {/if} +
+
+ +
+ + { + e.preventDefault(); + toggle(e); + }}> + + + + + + {#if !variable?.secret} + { + toggle(e); + currentVariable = + variable; + showUpdate = true; + }}> + Update + + {/if} + {#if !variable?.secret} + { + toggle(e); + + currentVariable = + variable; + showSecretModal = true; + }}> + Secret + + {/if} + { + toggle(e); + currentVariable = + variable; + showDelete = true; + }}> + Delete + + - - {:else} - - {/if} -
-
- -
- - { - e.preventDefault(); - toggle(e); - }}> - - - - - - {#if !variable?.secret} - { - toggle(e); - currentVariable = - variable; - showUpdate = true; - }}> - Update - - {/if} - {#if !variable?.secret} - { - toggle(e); - - currentVariable = - variable; - showSecretModal = true; - }}> - Secret - - {/if} - { - toggle(e); - currentVariable = variable; - showDelete = true; - }}> - Delete - - - - -
-
-
- {/each} -
+ +
+
+
+ {/each} +
+ {/snippet}
{:else} (showCreate = true)} diff --git a/src/routes/(console)/project-[project]/sites/create-site/templates/+page.svelte b/src/routes/(console)/project-[project]/sites/create-site/templates/+page.svelte index 3040a372f..4c69e6df5 100644 --- a/src/routes/(console)/project-[project]/sites/create-site/templates/+page.svelte +++ b/src/routes/(console)/project-[project]/sites/create-site/templates/+page.svelte @@ -1,6 +1,6 @@