import { HelpText } from './HelpText'; const SPECIAL_TARGETS = ['COMPLETE', 'ASK', 'ABORT', 'WAIT_SUBTASKS']; export interface RulesTableProps { rules: Array<{ condition: string; next: string }>; movementNames: string[]; onChange: (rules: Array<{ condition: string; next: string }>) => void; } export function RulesTable({ rules, movementNames, onChange }: RulesTableProps) { const nextOptions = [...movementNames, ...SPECIAL_TARGETS]; const updateRule = (index: number, field: 'condition' | 'next', value: string) => { const updated = rules.map((r, i) => (i === index ? { ...r, [field]: value } : r)); onChange(updated); }; const addRule = () => { onChange([...rules, { condition: '', next: movementNames[0] ?? 'COMPLETE' }]); }; const removeRule = (index: number) => { onChange(rules.filter((_, i) => i !== index)); }; return (
{rules.length > 0 && ( {rules.map((rule, i) => ( ))}
condition next
updateRule(i, 'condition', e.target.value)} className="w-full px-3 py-1.5 text-sm border border-slate-300 rounded-lg focus:ring-2 focus:ring-accent-ring focus:border-accent outline-none" placeholder="条件..." />
)} LLM が transition ツールで遷移先を選ぶ際の条件です
); }