feat: chatbot

This commit is contained in:
OpenSquared
2026-07-15 08:47:16 +02:00
parent da536e2638
commit ce9c0b53a9
11 changed files with 837 additions and 64 deletions

View File

@@ -5,9 +5,9 @@ import clsx from 'clsx'
// ── Types ─────────────────────────────────────────────────────────────────────
interface SignalParam {
type: 'int' | 'float' | 'pairs'
type: 'int' | 'float' | 'pairs' | 'select'
label: string
default: number | number[][]
default: number | number[][] | string
min?: number
max?: number
options?: string[]
@@ -263,6 +263,20 @@ function SignalToggle({
</div>
)
}
if (p.type === 'select') {
return (
<div key={key} className="flex items-center gap-3">
<label className="text-xs text-slate-400 w-28 shrink-0">{p.label}</label>
<select
value={value[key] ?? p.default}
onChange={e => update(key, e.target.value)}
className="w-32 bg-dark-900 border border-slate-700/40 rounded px-2 py-1 text-xs text-white"
>
{(p.options ?? []).map(o => <option key={o} value={o}>{o}</option>)}
</select>
</div>
)
}
return (
<div key={key} className="flex items-center gap-3">
<label className="text-xs text-slate-400 w-28 shrink-0">{p.label}</label>