diff --git a/src/components/nodes/BasicInfoNode.tsx b/src/components/nodes/BasicInfoNode.tsx new file mode 100644 index 0000000..082b614 --- /dev/null +++ b/src/components/nodes/BasicInfoNode.tsx @@ -0,0 +1,148 @@ +import { memo, useState } from 'react'; +import { Handle, Position } from '@xyflow/react'; +import type { NodeProps } from '@xyflow/react'; +import { Settings, ChevronDown, ChevronUp } from 'lucide-react'; +import type { BasicInfoNodeData } from '../../types/nodes'; + +export const BasicInfoNode = memo(({ data }: NodeProps) => { + const [isExpanded, setIsExpanded] = useState(true); + const nodeData = data as BasicInfoNodeData; + + const handleChange = (field: keyof BasicInfoNodeData, value: string | number | boolean | string[] | undefined | { width: number; height: number }) => { + // Update node data - in a real implementation, this would use a store or context + // For now, we'll use data mutation which React Flow handles + Object.assign(nodeData, { [field]: value }); + }; + + 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 ( +