mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
feat: create paginator component
This commit is contained in:
1 parent
a7575c0c16
commit
47d3a2b393
2 files changed
+20
No files matched your search
@@ -1,6 +1,7 @@
|
||||
export { default as Modal } from './modal.svelte';
|
||||
export { default as Pagination } from './pagination.svelte';
|
||||
export { default as PaginationInline } from './paginationInline.svelte';
|
||||
export { default as Paginator } from './paginator.svelte';
|
||||
export { default as Card } from './card.svelte';
|
||||
export { default as CardGrid } from './cardGrid.svelte';
|
||||
export { default as CardContainer } from './cardContainer.svelte';
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<script lang="ts">
|
||||
import PaginationInline from './paginationInline.svelte';
|
||||
|
||||
export let items = [];
|
||||
export let limit = 5;
|
||||
|
||||
let offset = 0;
|
||||
|
||||
$: paginatedItems = items.slice(offset, offset + limit);
|
||||
</script>
|
||||
|
||||
<div class="container">
|
||||
<slot {paginatedItems} />
|
||||
</div>
|
||||
|
||||
<div class="u-flex u-margin-block-start-32 u-main-space-between">
|
||||
<p class="text">Total results: {items?.length}</p>
|
||||
<PaginationInline {limit} bind:offset sum={items?.length} hidePages />
|
||||
</div>
|
||||
Reference in new issue
Block a user