diff --git a/web/src/components/strategy/VisualRuleBuilder.tsx b/web/src/components/strategy/VisualRuleBuilder.tsx index 4947616..497e89a 100644 --- a/web/src/components/strategy/VisualRuleBuilder.tsx +++ b/web/src/components/strategy/VisualRuleBuilder.tsx @@ -19,8 +19,8 @@ import { } from '@dnd-kit/sortable'; import { CSS } from '@dnd-kit/utilities'; import { GripVertical, Plus, Trash2, Save, Play } from 'lucide-react'; -import { Button } from '../ui/button'; import { Card, CardContent } from '../ui/card'; +import { Button, IconButton, Input, Select } from '../ui/Primitives'; // ─── Types ──────────────────────────────────────────────────────────────────── export type Indicator = 'RSI' | 'MACD' | 'EMA_50' | 'EMA_200' | 'Price' | 'Volume'; @@ -130,29 +130,35 @@ function RuleCard({ IF {/* Indicator */} - + })} + /> {/* Condition */} - + onChange(rule.id, { value: parseFloat(e.target.value) || 0 })} /> @@ -160,36 +166,51 @@ function RuleCard({ {/* Action */} - + controlSize="sm" + variant="surface" + options={[ + { value: 'BUY', label: 'BUY' }, + { value: 'SELL', label: 'SELL' }, + ]} + onChange={e => onChange(rule.id, { action: e.target.value as TradeAction })} + /> {/* Quantity */} - onChange(rule.id, { quantity: parseFloat(e.target.value) || 1 })} /> {/* Qty type */} - + setName(e.target.value)} + controlSize="sm" + variant="surface" style={{ border: '1px solid var(--border)', borderRadius: 12, padding: '7px 12px', fontSize: 14, fontWeight: 600, @@ -362,8 +382,11 @@ export function VisualRuleBuilder({ symbol, onSave, onBacktest }: Props) { {/* Add rule */} - + {/* Rule summary */} {rules.length > 0 && (