refactor: Cleanup

This commit is contained in:
Aleksander Grygier 2025-11-23 22:27:25 +01:00
parent 49c8062db1
commit d5a6671b81
1 changed files with 13 additions and 18 deletions

View File

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