Files
windmill/frontend/src/lib/components/copilot/CodeCompletionStatus.svelte
T
2025-10-04 09:59:10 +00:00

32 lines
786 B
Svelte

<script lang="ts">
import { copilotInfo } from '$lib/aiStore'
import { codeCompletionSessionEnabled, CODE_COMPLETION_SETTING_NAME } from '$lib/stores'
import { storeLocalSetting } from '$lib/utils'
import Toggle from '../Toggle.svelte'
function storeSetting() {
storeLocalSetting(CODE_COMPLETION_SETTING_NAME, $codeCompletionSessionEnabled.toString())
}
</script>
{#if $copilotInfo.enabled && $copilotInfo.codeCompletionModel}
<Toggle
size="xs"
bind:checked={$codeCompletionSessionEnabled}
on:change={() => {
storeSetting()
}}
options={{ right: 'AI code completion' }}
/>
{:else}
<Toggle
disabled
size="xs"
checked={false}
on:change={() => {
storeSetting()
}}
options={{ right: 'AI code completion (disabled in workspace settings)' }}
/>
{/if}