Skip to content

Commit

Permalink
💄 Use correct loading spinner
Browse files Browse the repository at this point in the history
  • Loading branch information
Malte2036 committed Oct 15, 2024
1 parent 489086c commit feac854
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"test": "vitest"
},
"dependencies": {
"@malte2036/thw-tools-components": "^0.2.13",
"@malte2036/thw-tools-components": "^0.2.17",
"marked": "^14.1.3",
"zod": "^3.23.8"
},
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/lib/LoadingSpinner.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<thw-loading-spinner />
5 changes: 3 additions & 2 deletions src/routes/(main)/ai/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { askAiKnowledgeBase, type AiKnowledgeBaseAskApiResponse } from '$lib/api/apiAi';
import Button from '$lib/Button.svelte';
import Input from '$lib/Input.svelte';
import LoadingSpinner from '$lib/LoadingSpinner.svelte';
let input = '';
Expand All @@ -15,14 +16,14 @@

<div class="flex flex-col content-between p-4 h-full">
<div class="flex flex-col gap-4 flex-grow bg-thw-100 rounded-lg p-2">
<h1 class="text-2xl font-bold">Ask AI</h1>
<h1 class="text-2xl font-bold">Ask Knowledge Base</h1>

<Input bind:inputValue={input} placeholder="Ask AI" />

<Button click={ask}>Ask</Button>

{#await response}
<p>Loading...</p>
<LoadingSpinner />
{:then data}
{#if data}
<div class="text-lg font-bold">Ergebniss aus der Knowledge Base:</div>
Expand Down

0 comments on commit feac854

Please # to comment.