import { FC } from "react"
import { NODE_HEIGHT, NODE_WIDTH } from "./constants"
import { Node } from "./types"
export interface NodeProp extends Node {
height?: number;
width?: number;
isOpen?: boolean;
onXClick?: () => void;
onOpenClick?: () => void;
}
export default ({
loc: [x,y],
text,
height=NODE_HEIGHT,
width=NODE_WIDTH,
onXClick=() => {},
onOpenClick=() => {},
isOpen=false,
color,
}: NodeProp) =>
X
{text}
{isOpen ? "▲" : "▼"}
export interface ConditionNodeProps extends NodeProp {
conditionType: string;
}
export const ConditionNode: FC = ({
loc: [x,y],
text,
height=NODE_HEIGHT,
width=NODE_WIDTH,
onXClick=() => {},
onOpenClick=() => {},
isOpen=false,
color,
conditionType,
children,
}) =>
{conditionType}
{children}