// import { useMemo } from 'react'; import { errorMessages, MarkerType, type EdgeMarker } from '@xyflow/system'; import { useStoreApi } from '../../hooks/useStore'; import { mergeProps } from 'solid-js'; type SymbolProps = Omit; const ArrowSymbol = (_p: SymbolProps) => { // { color = 'none', strokeWidth = 1 }: SymbolProps) => { const p = mergeProps({ color: 'none', strokeWidth: 1 }, _p); return ( ); }; const ArrowClosedSymbol = (_p: SymbolProps) => { // { color = 'none', strokeWidth = 1 }: SymbolProps) => { const p = mergeProps({ color: 'none', strokeWidth: 1 }, _p); return ( ); }; export const MarkerSymbols = { [MarkerType.Arrow]: ArrowSymbol, [MarkerType.ArrowClosed]: ArrowClosedSymbol, }; export function useMarkerSymbol(type: () => MarkerType) { const store = useStoreApi(); const symbol = () => { const symbolExists = Object.prototype.hasOwnProperty.call(MarkerSymbols, type()); if (!symbolExists) { store.onError.get()?.('009', errorMessages['error009'](type())); return null; } return MarkerSymbols[type()]; }; return symbol; }