({
selectedNodes,
highlightedNodeId,
enableEdit,
}: PathBarLinkProps)
| 99 | }; |
| 100 | |
| 101 | export function PathBarLink({ |
| 102 | selectedNodes, |
| 103 | highlightedNodeId, |
| 104 | enableEdit, |
| 105 | }: PathBarLinkProps) { |
| 106 | const { goToNodeId } = useJsonColumnViewAPI(); |
| 107 | |
| 108 | return ( |
| 109 | <div |
| 110 | className="flex flex-shrink-0 flex-grow-0 overflow-x-hidden" |
| 111 | onClick={(event) => { |
| 112 | if (event.detail == 2) { |
| 113 | enableEdit(); |
| 114 | } |
| 115 | }} |
| 116 | > |
| 117 | {selectedNodes.map((node, index) => { |
| 118 | return ( |
| 119 | <PathBarItem |
| 120 | key={index} |
| 121 | node={node} |
| 122 | isHighlighted={highlightedNodeId === node.id} |
| 123 | onClick={(id) => goToNodeId(id, "pathBar")} |
| 124 | isLast={index == selectedNodes.length - 1} |
| 125 | /> |
| 126 | ); |
| 127 | })} |
| 128 | <button |
| 129 | className="flex ml-auto justify-center items-center w-[26px] h-[26px] hover:bg-slate-300 dark:text-slate-400 dark:hover:bg-white dark:hover:bg-opacity-[10%]" |
| 130 | onClick={enableEdit}> |
| 131 | <PencilAltIcon className='h-5' /> |
| 132 | </button> |
| 133 | </div> |
| 134 | ); |
| 135 | } |
| 136 | |
| 137 | export function PathHistoryControls() { |
| 138 | const { canGoBack, canGoForward } = useJsonColumnViewState(); |
nothing calls this directly
no test coverage detected