Files
pi-gui/ui/src/components/ThinkingSelector.tsx
T
alex 0949c6f0d7 refactor!: remove redundant compatibility layers
Use native browser and Tauri behavior instead of custom selector, dialog, and window-state implementations. Remove obsolete bridge, relay, asset, and dependency paths to keep the supported surface small.

BREAKING CHANGE: The Noctalia relay no longer accepts --agent, and the Tauri host no longer exposes the legacy load_agent command.
2026-08-31 17:35:07 +02:00

54 lines
1.5 KiB
TypeScript

import { reconcileThinkingLevel, thinkingLevelOptions } from "../model-catalog";
import type { Model } from "../workspace/types";
import "./ModelSelector.css";
import "./ThinkingSelector.css";
type ThinkingSelectorProps = {
model?: Model;
label?: string;
value: string;
disabled?: boolean;
className?: string;
controlClassName?: string;
onChange: (level: string) => void;
};
export function ThinkingSelector({
model,
label = "Thinking",
value,
disabled = false,
className,
controlClassName,
onChange,
}: ThinkingSelectorProps) {
const options = thinkingLevelOptions(model);
return (
<label
className={["thinking-selector", className]
.filter(Boolean)
.join(" ")}
>
<span>{label}</span>
<select
className={[
"model-trigger",
"thinking-trigger",
controlClassName,
]
.filter(Boolean)
.join(" ")}
value={reconcileThinkingLevel(model, value)}
disabled={disabled}
onChange={(event) => onChange(event.currentTarget.value)}
>
{options.map((option) => (
<option value={option.value} key={option.value}>
{option.label}
</option>
))}
</select>
</label>
);
}