import type { NPCConfiguration, NPCInteraction } from '../types/npc'; interface NPCInteractionEditorProps { config: NPCConfiguration; onChange: (config: NPCConfiguration) => void; } export function NPCInteractionEditor({ config, onChange }: NPCInteractionEditorProps) { const handleInteractionChange = (interaction: NPCInteraction) => { onChange({ ...config, interaction }); }; const handleTypeChange = (type: NPCInteraction['type']) => { switch (type) { case 'dialogue': handleInteractionChange({ type: 'dialogue', dialogue: '' }); break; case 'script': handleInteractionChange({ type: 'script', script: '' }); break; case 'custom_script': handleInteractionChange({ type: 'custom_script', script: '' }); break; case 'none': handleInteractionChange({ type: 'none' }); break; } }; return (

Interaction Configuration

{(['dialogue', 'script', 'custom_script', 'none'] as const).map((type) => ( ))}
{config.interaction.type === 'dialogue' && (
handleInteractionChange({ type: 'dialogue', dialogue: e.target.value })} className="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500" placeholder="cobblemon:my_dialogue" />

Reference to a dialogue file (e.g., "cobblemon:my_dialogue" refers to data/cobblemon/dialogues/my_dialogue.json)

)} {config.interaction.type === 'script' && (
handleInteractionChange({ type: 'script', script: e.target.value })} className="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500" placeholder="cobblemon:my_script" />

Reference to a MoLang script file (e.g., "cobblemon:my_script" refers to data/cobblemon/molang/my_script.molang)

)} {config.interaction.type === 'custom_script' && (