From 30efc9f3a3cce11a9ffee8f3c26be96b4b5b47cf Mon Sep 17 00:00:00 2001 From: Allan Lasser Date: Thu, 29 Feb 2024 14:53:25 -0500 Subject: [PATCH] Move loading state out of ResultsList --- .../components/documents/ResultsList.svelte | 32 ++++++++----------- .../stories/ResultsList.stories.svelte | 4 --- src/routes/app/+page.svelte | 12 ++++--- 3 files changed, 21 insertions(+), 27 deletions(-) diff --git a/src/lib/components/documents/ResultsList.svelte b/src/lib/components/documents/ResultsList.svelte index 0e940a33c..f0fd5ccd1 100644 --- a/src/lib/components/documents/ResultsList.svelte +++ b/src/lib/components/documents/ResultsList.svelte @@ -10,7 +10,7 @@ import DocumentListItem from "./DocumentListItem.svelte"; import Flex from "../common/Flex.svelte"; import Checkbox from "../common/Checkbox.svelte"; - import { Hourglass24, Search24 } from "svelte-octicons"; + import { Search24 } from "svelte-octicons"; import Empty from "../common/Empty.svelte"; export let results: DocumentResults = undefined; @@ -26,24 +26,20 @@
- {#if !results} - Loading… + {#each results.results as document (document.id)} + + updateSelection(event, document.id)} + /> + + {:else} - {#each results.results as document (document.id)} - - updateSelection(event, document.id)} - /> - - - {:else} - -

{$_("noDocuments.noSearchResults")}

-

{$_("noDocuments.queryNoResults")}

-
- {/each} - {/if} + +

{$_("noDocuments.noSearchResults")}

+

{$_("noDocuments.queryNoResults")}

+
+ {/each}