fix: templating padding

This commit is contained in:
Arman
2025-04-28 11:27:27 +02:00
parent 33108c2899
commit d6307ccf81
2 changed files with 15 additions and 2 deletions
+14 -1
View File
@@ -2,6 +2,7 @@
import { Layout, Typography } from '@appwrite.io/pink-svelte';
import PaginationInline from './paginationInline.svelte';
import Limit from './limit.svelte';
import type { Snippet } from 'svelte';
let {
items = [],
@@ -10,7 +11,19 @@
hidePages = true,
hasLimit = false,
name = 'items',
gap = 's',
children
}: {
items: unknown[];
limit: number;
hideFooter?: boolean;
hidePages?: boolean;
hasLimit?: boolean;
name?: string;
gap?:
| ('none' | 'xxxs' | 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxxl')
| undefined;
children: Snippet<[unknown[], number]>;
} = $props();
let total = $derived(items.length);
@@ -20,7 +33,7 @@
let paginatedItems = $derived(items.slice(offset, offset + limit));
</script>
<Layout.Stack gap="s">
<Layout.Stack {gap}>
{@render children(paginatedItems, limit)}
{#if !hideFooter}
@@ -125,7 +125,7 @@
</svelte:fragment>
<Layout.Stack gap="l">
{#if data.templates?.length > 0}
<Paginator items={data.templates} limit={12} hidePages={false} hasLimit>
<Paginator items={data.templates} limit={12} hidePages={false} hasLimit gap="m">
{#snippet children(paginatedItems: typeof data.templates)}
<Layout.Grid columns={3} columnsXS={2} columnsXXS={1}>
{#each paginatedItems as template (template.name)}