|
|
@ -281,12 +281,21 @@ export function GenerateRoadmap() { |
|
|
|
setGeneratedRoadmapContent(data); |
|
|
|
setGeneratedRoadmapContent(data); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const handleSvgClick = useCallback( |
|
|
|
const handleNodeClick = useCallback( |
|
|
|
(e: MouseEvent<HTMLDivElement, globalThis.MouseEvent>) => { |
|
|
|
(e: MouseEvent<HTMLDivElement, globalThis.MouseEvent>) => { |
|
|
|
|
|
|
|
if (isLoading) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const target = e.target as SVGElement; |
|
|
|
const target = e.target as SVGElement; |
|
|
|
const { nodeId, nodeType, targetGroup, nodeTitle, parentTitle } = |
|
|
|
const { nodeId, nodeType, targetGroup, nodeTitle, parentTitle } = |
|
|
|
getNodeDetails(target) || {}; |
|
|
|
getNodeDetails(target) || {}; |
|
|
|
if (!nodeId || !nodeType || !allowedClickableNodeTypes.includes(nodeType)) |
|
|
|
if ( |
|
|
|
|
|
|
|
!nodeId || |
|
|
|
|
|
|
|
!nodeType || |
|
|
|
|
|
|
|
!allowedClickableNodeTypes.includes(nodeType) || |
|
|
|
|
|
|
|
!nodeTitle |
|
|
|
|
|
|
|
) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
if (nodeType === 'button' || nodeType === 'link-item') { |
|
|
|
if (nodeType === 'button' || nodeType === 'link-item') { |
|
|
@ -307,7 +316,7 @@ export function GenerateRoadmap() { |
|
|
|
...(nodeType === 'subtopic' && { parentTitle }), |
|
|
|
...(nodeType === 'subtopic' && { parentTitle }), |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
[], |
|
|
|
[isLoading], |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
@ -465,7 +474,7 @@ export function GenerateRoadmap() { |
|
|
|
<div |
|
|
|
<div |
|
|
|
ref={roadmapContainerRef} |
|
|
|
ref={roadmapContainerRef} |
|
|
|
id="roadmap-container" |
|
|
|
id="roadmap-container" |
|
|
|
onClick={handleSvgClick} |
|
|
|
onClick={handleNodeClick} |
|
|
|
className="relative px-4 py-5 [&>svg]:mx-auto [&>svg]:max-w-[1300px]" |
|
|
|
className="relative px-4 py-5 [&>svg]:mx-auto [&>svg]:max-w-[1300px]" |
|
|
|
/> |
|
|
|
/> |
|
|
|
</section> |
|
|
|
</section> |
|
|
|