diff --git a/src/routes/console/project-[project]/databases/database-[database]/[[page]]/+page.svelte b/src/routes/console/project-[project]/databases/database-[database]/[[page]]/+page.svelte index 7a33759a6d..74247a5fa3 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/[[page]]/+page.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/[[page]]/+page.svelte @@ -2,7 +2,16 @@ import { page } from '$app/stores'; import { goto } from '$app/navigation'; import { Button } from '$lib/elements/forms'; - import { Empty, Copy, GridItem1, CardContainer, Heading, Pagination } from '$lib/components'; + import { + Empty, + EmptySearch, + Copy, + GridItem1, + CardContainer, + Heading, + Pagination, + SearchQuery + } from '$lib/components'; import { Pill } from '$lib/elements'; import { Container } from '$lib/layout'; import { base } from '$app/paths'; @@ -29,13 +38,15 @@ -
+
Collections - + + +
{#if data.collections.total} @@ -71,6 +82,15 @@ offset={data.offset} sum={data.collections.total} />
+ {:else if data.search} + +
+ Sorry, we couldn't find '{data.search}' +

There are no collections that match your search.

+
+ +
{:else} { +export const load: PageLoad = async ({ params, parent, url }) => { await parent(); const page = Number(params.page); const offset = pageToOffset(page, CARD_LIMIT); + const search = url.search.slice(1) ?? undefined; return { offset, - collections: await sdkForProject.databases.listCollections(params.database, [ - Query.limit(CARD_LIMIT), - Query.offset(offset), - Query.orderDesc('$createdAt') - ]) + search, + collections: await sdkForProject.databases.listCollections( + params.database, + [Query.limit(CARD_LIMIT), Query.offset(offset), Query.orderDesc('$createdAt')], + search + ) }; };