import React, { FC } from "react"; import { intentClassName, IntentTypes } from "../../../common/Intent"; import { CLASSPREFIX as eccgui } from "../../../configuration/constants"; // FIXME: we need to check how these markers are used and if we can justify the namings import { MarkerArrowClosedInverse } from "./MarkerArrowClosedInverse"; type ReactFlowMarkerAppearance = "arrow-closed"; interface ReactFlowMarkerProps extends React.SVGProps { /** * Visual appearance of the marker. */ appearance?: ReactFlowMarkerAppearance; /** * Feedback state of the marker. * SVG markers are reused by paths but they cannot inherit their state color automatically. */ intent?: IntentTypes; /** * If set, then the marker orientation is reversed. * Can be used if a start marker should displayed similar to an end marker. */ reverse?: boolean; } const ReactFlowMarker = ({ className, appearance = "arrow-closed", intent, reverse }: ReactFlowMarkerProps) => { const markerDisplay: Record = { "arrow-closed": ( ), }; return ( {markerDisplay[appearance] as React.ReactNode} ); }; const ReactFlowMarkers: FC = () => { const intents = ["none", "primary", "accent", "success", "warning", "danger", "info"] as IntentTypes[]; return ( {intents.map((intent, index) => ( ))} ); }; export { MarkerArrowClosedInverse, ReactFlowMarkers, ReactFlowMarker };