|
3 | 3 | import { Button } from '$lib/components/ui/button'; |
4 | 4 | import ChatFormActionFileAttachments from './ChatFormActionFileAttachments.svelte'; |
5 | 5 | import ChatFormActionRecord from './ChatFormActionRecord.svelte'; |
| 6 | + import ChatFormModelSelector from './ChatFormModelSelector.svelte'; |
| 7 | + import { config } from '$lib/stores/settings.svelte'; |
6 | 8 | import type { FileTypeCategory } from '$lib/enums/files'; |
7 | 9 |
|
8 | 10 | interface Props { |
|
26 | 28 | onMicClick, |
27 | 29 | onStop |
28 | 30 | }: Props = $props(); |
| 31 | +
|
| 32 | + let currentConfig = $derived(config()); |
29 | 33 | </script> |
30 | 34 |
|
31 | | -<div class="flex items-center justify-between gap-1 {className}"> |
32 | | - <ChatFormActionFileAttachments {disabled} {onFileUpload} /> |
| 35 | +<div class="flex w-full items-center gap-2 {className}"> |
| 36 | + <ChatFormActionFileAttachments class="mr-auto" {disabled} {onFileUpload} /> |
| 37 | + |
| 38 | + {#if currentConfig.modelSelectorEnabled} |
| 39 | + <ChatFormModelSelector class="shrink-0" /> |
| 40 | + {/if} |
33 | 41 |
|
34 | | - <div class="flex gap-2"> |
35 | | - {#if isLoading} |
36 | | - <Button |
37 | | - type="button" |
38 | | - onclick={onStop} |
39 | | - class="h-8 w-8 bg-transparent p-0 hover:bg-destructive/20" |
40 | | - > |
41 | | - <span class="sr-only">Stop</span> |
42 | | - <Square class="h-8 w-8 fill-destructive stroke-destructive" /> |
43 | | - </Button> |
44 | | - {:else} |
45 | | - <ChatFormActionRecord {disabled} {isLoading} {isRecording} {onMicClick} /> |
| 42 | + {#if isLoading} |
| 43 | + <Button |
| 44 | + type="button" |
| 45 | + onclick={onStop} |
| 46 | + class="h-8 w-8 bg-transparent p-0 hover:bg-destructive/20" |
| 47 | + > |
| 48 | + <span class="sr-only">Stop</span> |
| 49 | + <Square class="h-8 w-8 fill-destructive stroke-destructive" /> |
| 50 | + </Button> |
| 51 | + {:else} |
| 52 | + <ChatFormActionRecord {disabled} {isLoading} {isRecording} {onMicClick} /> |
46 | 53 |
|
47 | | - <Button |
48 | | - type="submit" |
49 | | - disabled={!canSend || disabled || isLoading} |
50 | | - class="h-8 w-8 rounded-full p-0" |
51 | | - > |
52 | | - <span class="sr-only">Send</span> |
53 | | - <ArrowUp class="h-12 w-12" /> |
54 | | - </Button> |
55 | | - {/if} |
56 | | - </div> |
| 54 | + <Button |
| 55 | + type="submit" |
| 56 | + disabled={!canSend || disabled || isLoading} |
| 57 | + class="h-8 w-8 rounded-full p-0" |
| 58 | + > |
| 59 | + <span class="sr-only">Send</span> |
| 60 | + <ArrowUp class="h-12 w-12" /> |
| 61 | + </Button> |
| 62 | + {/if} |
57 | 63 | </div> |
0 commit comments