-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: implement ChatContainer component and update layout for ses…
…sion handling
- Loading branch information
1 parent
cae1da3
commit eea5481
Showing
6 changed files
with
52 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<div class="relative overflow-hidden w-full flex flex-col h-full"> | ||
<div class="overflow-auto px-10 w-full block h-[calc(85%-2.5rem)]"> | ||
<div class="flex flex-col gap-y-2"> | ||
<h1 class="text-5xl font-bold">🎧 Audiora</h1> | ||
<h2 class="text-lg">Listen to anything, anytime.</h2> | ||
</div> | ||
|
||
<slot name="content"></slot> | ||
</div> | ||
|
||
<div class="h-[16%] fixed w-[calc(100%-24.5rem)] bottom-0 shrink-0"> | ||
<slot name="chat_input"></slot> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import type { ParamMatcher } from '@sveltejs/kit'; | ||
export const match: ParamMatcher = (param: string) => param != null && param !== 'null'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,18 @@ | ||
<script lang="ts"> | ||
// import { browser } from '$app/environment'; | ||
// import { goto } from '$app/navigation'; | ||
// import { page } from '$app/stores'; | ||
// import { sessionStore } from '$lib/stores/session'; | ||
// import ChatInterface from '$lib/components/ChatInterface.svelte'; | ||
// import AudioInterface from '$lib/components/AudioInterface.svelte'; | ||
// $: userSpecification = $sessionStore.userSpecification; | ||
import RenderExamples from '@/components/RenderExamples.svelte'; | ||
import ChatContainer from '@/components/ChatContainer.svelte'; | ||
export let data; | ||
$: sessionId = data.sessionId; | ||
</script> | ||
|
||
<svelte:head> | ||
<title>Audiora</title> | ||
</svelte:head> | ||
|
||
<div class="relative overflow-hidden w-full flex flex-col h-full"> | ||
<div class="overflow-auto px-10 w-full block h-[calc(85%-2.5rem)]"> | ||
<div class="flex flex-col gap-y-2"> | ||
<h1 class="text-5xl font-bold">🎧 Audiora</h1> | ||
<h2 class="text-lg">Listen to anything, anytime.</h2> | ||
</div> | ||
<ChatContainer> | ||
<RenderExamples slot="content" {sessionId} /> | ||
|
||
<RenderExamples {sessionId} /> | ||
<div slot="chat_input" class="h-[16%] fixed w-[calc(100%-24.5rem)] bottom-0 shrink-0"> | ||
Chat Input Section | ||
</div> | ||
|
||
<div class="h-[16%] fixed w-[calc(100%-24.5rem)] bottom-0 shrink-0">Chat Input Section</div> | ||
<!-- {#if !userSpecification} | ||
<ChatInterface /> | ||
{:else} | ||
<AudioInterface /> | ||
{/if} --> | ||
</div> | ||
</ChatContainer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { error } from '@sveltejs/kit'; | ||
import type { PageServerLoad } from './$types'; | ||
|
||
export const load: PageServerLoad = ({ url }) => { | ||
const category = url.searchParams.get('category'); | ||
if (!category) error(400, 'Audio category was not found'); | ||
|
||
return { | ||
category | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<script> | ||
import ChatContainer from '@/components/ChatContainer.svelte'; | ||
export let data; | ||
$: category = data.category; | ||
$: sessionId = data.sessionId; | ||
</script> | ||
|
||
<ChatContainer> | ||
<div slot="content"> | ||
{sessionId}: {category} | ||
</div> | ||
|
||
<div slot="chat_input" class="h-[16%] fixed w-[calc(100%-24.5rem)] bottom-0 shrink-0"> | ||
Chat Input Section | ||
</div> | ||
</ChatContainer> |