import React from 'react'; import type { NPCConfiguration, NPCHitboxValue } from '../types/npc'; interface NPCBasicSettingsProps { config: NPCConfiguration; onChange: (config: NPCConfiguration) => void; } export const NPCBasicSettings: React.FC = ({ config, onChange }) => { const handleChange = (field: keyof NPCConfiguration, value: any) => { onChange({ ...config, [field]: value }); }; const handleHitboxChange = (hitbox: NPCHitboxValue) => { handleChange('hitbox', hitbox); }; const handleNamesChange = (names: string) => { handleChange('names', names.split(',').map(name => name.trim()).filter(name => name)); }; const handleAspectsChange = (aspects: string) => { handleChange('aspects', aspects ? aspects.split(',').map(aspect => aspect.trim()).filter(aspect => aspect) : undefined); }; return (

Basic Settings

handleChange('resourceIdentifier', 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:npc_name" />
handleNamesChange(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="NPC Name 1, NPC Name 2" />
{typeof config.hitbox === "object" && (
handleHitboxChange({ width: parseFloat(e.target.value), height: typeof config.hitbox === "object" ? config.hitbox.height : 1.8 })} className="block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 text-sm" />
handleHitboxChange({ width: typeof config.hitbox === "object" ? config.hitbox.width : 0.6, height: parseFloat(e.target.value) })} className="block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 text-sm" />
)}
handleChange('modelScale', parseFloat(e.target.value))} className="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500" />
handleAspectsChange(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="aspect1, aspect2" />

Behavior Settings

); };