feat(quick-pane): add compact runtime controls
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
import { reconcileThinkingLevel, thinkingLevelOptions } from "../model-catalog";
|
||||
import type { Model } from "../workspace/types";
|
||||
import "./ThinkingSelector.css";
|
||||
|
||||
type ThinkingSelectorProps = {
|
||||
model?: Model;
|
||||
value: string;
|
||||
disabled?: boolean;
|
||||
className?: string;
|
||||
onChange: (level: string) => void;
|
||||
};
|
||||
|
||||
export function ThinkingSelector({
|
||||
model,
|
||||
value,
|
||||
disabled = false,
|
||||
className,
|
||||
onChange,
|
||||
}: ThinkingSelectorProps) {
|
||||
const selected = reconcileThinkingLevel(model, value);
|
||||
const classes = ["thinking-selector", className].filter(Boolean).join(" ");
|
||||
|
||||
return (
|
||||
<label className={classes}>
|
||||
<span>Thinking</span>
|
||||
<select
|
||||
aria-label="Thinking"
|
||||
value={selected}
|
||||
disabled={disabled}
|
||||
onChange={(event) => onChange(event.currentTarget.value)}
|
||||
>
|
||||
{thinkingLevelOptions(model).map((option) => (
|
||||
<option key={option.value} value={option.value}>
|
||||
{option.label}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user