diff --git a/client/public/icons/node/ifElse.svg b/client/public/icons/node/ifElse.svg new file mode 100644 index 0000000..8fa0c29 --- /dev/null +++ b/client/public/icons/node/ifElse.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/client/src/components/nodes/IfElseNode.tsx b/client/src/components/nodes/IfElseNode.tsx new file mode 100644 index 0000000..905bf4a --- /dev/null +++ b/client/src/components/nodes/IfElseNode.tsx @@ -0,0 +1,87 @@ +import { Handle, NodeProps, Position, Node } from "@xyflow/react"; + +type IfElseNodeData = { + condition?: string; +}; + +export default function IfElseNode({ data }: NodeProps) { + return ( +
{ + e.stopPropagation(); + console.log("data", data); + }} + > +
+ ЕСЛИ - ТО +
+ +
+ Если {data.condition as string}, то +
+ +
+ Иначе +
+ + + + + +
+ ); +} diff --git a/client/src/main.tsx b/client/src/main.tsx index c07c04b..116858c 100644 --- a/client/src/main.tsx +++ b/client/src/main.tsx @@ -1,11 +1,12 @@ -import React from 'react'; -import ReactDOM from 'react-dom/client'; -import '@/index.css'; -import App from '@/App'; -import AppWrapper from '@/config/AppWrapper'; +import React from "react"; +import ReactDOM from "react-dom/client"; +import "@/index.css"; +import App from "@/App"; +import AppWrapper from "@/config/AppWrapper"; +import "@xyflow/react/dist/style.css"; const root = ReactDOM.createRoot( - document.getElementById('root') as HTMLElement + document.getElementById("root") as HTMLElement ); root.render(