feat: changed startNode to use custom type for data
changed to startNode file to be a general file for custom node types, and created a custom type for the data property of StartNode. BREAKING: renamed StartNode.tsx to NodeDefinitions.tsx ref: N25B-114
This commit is contained in:
22
src/visualProgrammingUI/components/NodeDefinitions.tsx
Normal file
22
src/visualProgrammingUI/components/NodeDefinitions.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Handle, Position } from '@xyflow/react';
|
||||
import '@xyflow/react/dist/style.css';
|
||||
import '../VisProgUI.css';
|
||||
|
||||
// Datatypes for NodeTypes
|
||||
|
||||
type startNodeData = { label: string; };
|
||||
|
||||
// Definitions of Nodes
|
||||
|
||||
|
||||
export const StartNode= ({ data } : {data : startNodeData}) => {
|
||||
return (
|
||||
<>
|
||||
<div>
|
||||
<div className="default-node"> data test {data.label} </div>
|
||||
<Handle type="source" position={Position.Right} id="start" />
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default StartNode;
|
||||
Reference in New Issue
Block a user