refactor of graph pt2

This commit is contained in:
ari committed 2022-07-11 17:12:49 -04:00
1 parent 730c804c22
commit 2cb2e779d7
20 files changed
+714 -246

No files matched your search

@@ -0,0 +1,39 @@
import "./ButtonNode.css";
import { ButtonIcon } from "components/Icons/ButtonIcons";
import { FC } from "react";
import { ButtonNodeProps } from "./types";
import { Handle, Position } from "react-flow-renderer";
export const ButtonNode: FC<ButtonNodeProps> = ({
height,
width,
icon,
flipped,
onClick,
}) => {
return (
<div
className="button-node"
style={
{
"--button-height": `${height}px`,
"--button-width": `${width}px`,
} as any
}
>
<ButtonIcon
icon={
<>
<Handle
type="target"
position={flipped ? Position.Top : Position.Left}
/>
{icon}
</>
}
onClick={onClick}
/>
</div>
);
};