-
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.
move ui logic for auto_detected_category to own file
- Loading branch information
1 parent
0b23436
commit 5f2db7a
Showing
2 changed files
with
46 additions
and
38 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,43 @@ | ||
<script lang="ts" context="module"> | ||
import type { ContentCategory } from '@/utils/types'; | ||
export const categoryArticleMap: Record<ContentCategory, string> = { | ||
podcast: 'a podcast', | ||
sermon: 'a sermon', | ||
audiodrama: 'an audiodrama', | ||
lecture: 'a lecture', | ||
commentary: 'a commentary', | ||
voicenote: 'a voicenote', | ||
interview: 'an interview', | ||
soundbite: 'a soundbite' | ||
}; | ||
</script> | ||
|
||
<script lang="ts"> | ||
import ChatListItem from './ChatListItem.svelte'; | ||
import { Button } from './ui/button'; | ||
import { createEventDispatcher } from 'svelte'; | ||
import { ArrowRight } from 'lucide-svelte'; | ||
export let category: ContentCategory; | ||
const dispatch = createEventDispatcher<{ selectCategory: { value: ContentCategory } }>(); | ||
$: categoryWithArticle = `"${categoryArticleMap[category]}"`; | ||
</script> | ||
|
||
<ChatListItem | ||
type="assistant" | ||
content="I auto-detected you want {categoryWithArticle}. Press NEXT to continue if correct." | ||
/> | ||
|
||
<Button | ||
variant="ghost" | ||
class="text-base px-10 py-6 bg-gray-800 w-fit hover:bg-gray-700" | ||
on:click={() => dispatch('selectCategory', { value: category })} | ||
> | ||
<span> Next </span> | ||
<ArrowRight class="w-4 ml-1 inline" /> | ||
</Button> | ||
|
||
<ChatListItem type="assistant" content="Else, select your audiocast 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