Skip to content
Snippets Groups Projects
Commit 2f8a1063 authored by ali asaria's avatar ali asaria
Browse files

move custom node to memo

parent a81bb506
No related branches found
No related tags found
No related merge requests found
import { Typography } from '@mui/joy';
import { BuiltInNode, Handle } from '@xyflow/react';
import { NodeProps, Position } from '@xyflow/system';
import { CircleXIcon, SquareXIcon, XIcon } from 'lucide-react';
import { XIcon } from 'lucide-react';
export default function CustomNode({
export default function memo({
data,
isConnectable,
targetPosition = Position.Top,
......@@ -17,6 +18,9 @@ export default function CustomNode({
cursor: 'pointer',
borderRadius: '50%',
}}
onClick={() => {
alert('delete node');
}}
>
<XIcon size="12px" />
</div>
......@@ -25,7 +29,9 @@ export default function CustomNode({
position={targetPosition}
isConnectable={isConnectable}
/>
{data?.label}
<Typography level="title-sm">{data?.label}</Typography>
<Typography level="body-sm">{data?.jobType}</Typography>
<Typography level="body-sm">{data?.template}</Typography>
<Handle
type="source"
position={sourcePosition}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment