import React, { useMemo } from 'react'; import { MarkerType, EdgeMarker } from '../../types'; type SymbolProps = Omit; const ArrowSymbol = ({ color = 'none', strokeWidth = 1 }: SymbolProps) => { return ( ); }; const ArrowClosedSymbol = ({ color = 'none', strokeWidth = 1 }: SymbolProps) => { return ( ); }; export const MarkerSymbols = { [MarkerType.Arrow]: ArrowSymbol, [MarkerType.ArrowClosed]: ArrowClosedSymbol, }; export function useMarkerSymbol(type: MarkerType) { const symbol = useMemo(() => { const symbolExists = MarkerSymbols.hasOwnProperty(type); if (!symbolExists) { // @ts-ignore if (process.env.NODE_ENV === 'development') { console.warn(`[React Flow]: Marker type "${type}" doesn't exist. Help: https://reactflow.dev/error#900`); } return () => null; } return MarkerSymbols[type]; }, [type]); return symbol; } export default MarkerSymbols;