refactor: Cleanup
This commit is contained in:
parent
49c8062db1
commit
d5a6671b81
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
canSend?: boolean;
|
canSend?: boolean;
|
||||||
className?: string;
|
class?: string;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
isLoading?: boolean;
|
isLoading?: boolean;
|
||||||
isRecording?: boolean;
|
isRecording?: boolean;
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
let {
|
let {
|
||||||
canSend = false,
|
canSend = false,
|
||||||
className = '',
|
class: className = '',
|
||||||
disabled = false,
|
disabled = false,
|
||||||
isLoading = false,
|
isLoading = false,
|
||||||
isRecording = false,
|
isRecording = false,
|
||||||
|
|
@ -48,7 +48,6 @@
|
||||||
let shouldShowRecordButton = $derived(
|
let shouldShowRecordButton = $derived(
|
||||||
hasAudioModality && !hasText && !hasAudioAttachments && currentConfig.autoMicOnEmpty
|
hasAudioModality && !hasText && !hasAudioAttachments && currentConfig.autoMicOnEmpty
|
||||||
);
|
);
|
||||||
let shouldShowSubmitButton = $derived(!shouldShowRecordButton || hasAudioAttachments);
|
|
||||||
|
|
||||||
let isSelectedModelInCache = $derived.by(() => {
|
let isSelectedModelInCache = $derived.by(() => {
|
||||||
const currentModelId = selectedModelId();
|
const currentModelId = selectedModelId();
|
||||||
|
|
@ -73,12 +72,9 @@
|
||||||
<span class="sr-only">Stop</span>
|
<span class="sr-only">Stop</span>
|
||||||
<Square class="h-8 w-8 fill-destructive stroke-destructive" />
|
<Square class="h-8 w-8 fill-destructive stroke-destructive" />
|
||||||
</Button>
|
</Button>
|
||||||
{:else}
|
{:else if shouldShowRecordButton}
|
||||||
{#if shouldShowRecordButton}
|
|
||||||
<ChatFormActionRecord {disabled} {isLoading} {isRecording} {onMicClick} />
|
<ChatFormActionRecord {disabled} {isLoading} {isRecording} {onMicClick} />
|
||||||
{/if}
|
{:else}
|
||||||
|
|
||||||
{#if shouldShowSubmitButton}
|
|
||||||
<ChatFormActionSubmit
|
<ChatFormActionSubmit
|
||||||
{canSend}
|
{canSend}
|
||||||
{disabled}
|
{disabled}
|
||||||
|
|
@ -89,5 +85,4 @@
|
||||||
isModelAvailable={isSelectedModelInCache}
|
isModelAvailable={isSelectedModelInCache}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue