2 import { ICON_CLASS_DEFAULT } from '$lib/constants/css-classes';
3 import { Lightbulb, LightbulbOff, Check, Info } from '@lucide/svelte';
4 import * as DropdownMenu from '$lib/components/ui/dropdown-menu';
5 import * as Tooltip from '$lib/components/ui/tooltip';
6 import { useReasoningMenu } from '$lib/hooks/use-reasoning-menu.svelte';
8 const reasoning = useReasoningMenu();
11 {#if reasoning.modelSupportsThinking}
13 <DropdownMenu.SubTrigger class="flex cursor-pointer items-center gap-2">
14 {#if reasoning.thinkingEnabled}
15 <Lightbulb class="{ICON_CLASS_DEFAULT} shrink-0 text-amber-400" />
16 {:else if reasoning.isOff}
17 <LightbulbOff class="{ICON_CLASS_DEFAULT} shrink-0 text-muted-foreground" />
19 <Lightbulb class="{ICON_CLASS_DEFAULT} shrink-0 text-muted-foreground" />
23 class="text-sm inline-flex gap-2 {!reasoning.thinkingEnabled
24 ? 'text-muted-foreground'
29 <span class="capitalize text-muted-foreground">
30 {reasoning.currentEffort}
33 </DropdownMenu.SubTrigger>
35 <DropdownMenu.SubContent
36 class="w-60 bg-popover p-1.5 text-popover-foreground shadow-md outline-none"
38 {#each reasoning.levels as level (level.value)}
39 {@const tokenLabel = reasoning.tokenLabel(level)}
41 class="flex w-full cursor-pointer items-center gap-3 rounded-md px-2 py-1.75 text-left text-sm transition-colors hover:bg-accent {reasoning.isSelected(
46 onclick={() => reasoning.select(level)}
48 {#if reasoning.isSelected(level)}
49 <Check class="{ICON_CLASS_DEFAULT} shrink-0 text-foreground" />
51 <div class="{ICON_CLASS_DEFAULT} shrink-0"></div>
54 <span class="flex-1">{level.label}</span>
57 <span class="text-[11px] text-muted-foreground opacity-60">
65 <Info class="h-3.5 w-3.5 shrink-0 text-muted-foreground" />
67 <Tooltip.Content side="left">
68 <p>Maximum reasoning effort with extended context usage</p>
74 </DropdownMenu.SubContent>