diff --git a/frontend/src/lib/components/advanced-table.svelte b/frontend/src/lib/components/advanced-table.svelte index 8e73485..f7a477a 100644 --- a/frontend/src/lib/components/advanced-table.svelte +++ b/frontend/src/lib/components/advanced-table.svelte @@ -4,6 +4,7 @@ import * as Pagination from '$lib/components/ui/pagination'; import * as Select from '$lib/components/ui/select'; import * as Table from '$lib/components/ui/table/index.js'; + import Empty from '$lib/icons/empty.svelte'; import type { Paginated } from '$lib/types/pagination.type'; import { debounced } from '$lib/utils/debounce-util'; import type { Snippet } from 'svelte'; @@ -66,93 +67,102 @@ } -
- {#if !withoutSearch} - onSearch((e.target as HTMLInputElement).value)} - /> - {/if} - - - - {#if selectedIds} - - onAllCheck(c as boolean)} /> - - {/if} - {#each columns as column} - {#if typeof column === 'string'} - {column} - {:else} - {column.label} - {/if} - {/each} - - - - {#each items.data as item} - - {#if selectedIds} - - onCheck(c as boolean, item.id)} - /> - - {/if} - {@render rows({ item })} - - {/each} - - -
-
-

Items per page

- onPageSizeChange(v?.value as number)} - > - - {items.pagination.itemsPerPage} - - - {#each availablePageSizes as size} - {size} - {/each} - - -
- - - - - - {#each pages as page (page.key)} - {#if page.type !== 'ellipsis'} - - - {page.value} - - - {/if} - {/each} - - - - - +{#if items.data.length === 0} +
+ +

No items found

-
+{:else} +
+ {#if !withoutSearch} + onSearch((e.target as HTMLInputElement).value)} + /> + {/if} + + + + + {#if selectedIds} + + onAllCheck(c as boolean)} /> + + {/if} + {#each columns as column} + {#if typeof column === 'string'} + {column} + {:else} + {column.label} + {/if} + {/each} + + + + {#each items.data as item} + + {#if selectedIds} + + onCheck(c as boolean, item.id)} + /> + + {/if} + {@render rows({ item })} + + {/each} + + + +
+
+

Items per page

+ onPageSizeChange(v?.value as number)} + > + + {items.pagination.itemsPerPage} + + + {#each availablePageSizes as size} + {size} + {/each} + + +
+ + + + + + {#each pages as page (page.key)} + {#if page.type !== 'ellipsis'} + + + {page.value} + + + {/if} + {/each} + + + + + +
+
+{/if} diff --git a/frontend/src/lib/icons/empty.svelte b/frontend/src/lib/icons/empty.svelte new file mode 100644 index 0000000..6142e6f --- /dev/null +++ b/frontend/src/lib/icons/empty.svelte @@ -0,0 +1,24 @@ + + + + + + +