diff --git a/src/lib/components/database/DatabaseGridWithProvider.svelte b/src/lib/components/database/DatabaseGridWithProvider.svelte index 9dbe2e03..2af248c8 100644 --- a/src/lib/components/database/DatabaseGridWithProvider.svelte +++ b/src/lib/components/database/DatabaseGridWithProvider.svelte @@ -17,11 +17,7 @@ pageSize?: number } - const { - resource, - columns, - pageSize: initialPageSize = 20 - }: Props = $props() + const { resource, columns, pageSize: initialPageSize = 20 }: Props = $props() // State let data = $state([]) @@ -71,8 +67,8 @@ api.setNext(provider) // Add row click handler - api.on("select-row", (ev: any) => { - console.log("Row selected:", ev) + api.on('select-row', (ev: any) => { + console.log('Row selected:', ev) const rowId = ev.id if (rowId) { // Find the row data to get the granblue_id @@ -85,7 +81,6 @@ }) } - // Handle pagination const handlePrevPage = () => { if (currentPage > 1) { @@ -102,7 +97,7 @@ const handlePageSizeChange = async (event: Event) => { const target = event.target as HTMLSelectElement const newPageSize = Number(target.value) - pageSize = newPageSize // Update local state immediately + pageSize = newPageSize // Update local state immediately await provider.setPageSize(newPageSize) loadData(1) } @@ -126,7 +121,6 @@ handleSearch(searchTerm) }) - // Computed values const startItem = $derived((currentPage - 1) * pageSize + 1) const endItem = $derived(Math.min(currentPage * pageSize, total)) @@ -144,16 +138,9 @@ }) -
-
- +
+
+
@@ -173,12 +160,7 @@
{/if} - +
- @@ -215,59 +193,62 @@
\ No newline at end of file +