import { useMemo } from 'react'; import { devWarn } from '../../utils'; import { MarkerType } from '../../types'; import type { 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 = Object.prototype.hasOwnProperty.call(MarkerSymbols, type); if (!symbolExists) { devWarn(`Marker type "${type}" doesn't exist. Help: https://reactflow.dev/error#900`); return null; } return MarkerSymbols[type]; }, [type]); return symbol; } export default MarkerSymbols;