)
}
const Line = ({ next }: { next?: HttpTypes.AdminWorkflowExecutionStep[] }) => {
if (!next) {
return null
}
return (
)
}
const Node = ({ step }: { step: HttpTypes.AdminWorkflowExecutionStep }) => {
if (step.id === "_root") {
return null
}
const stepId = step.id.split(".").pop()
/**
* We can't rely on the built-in hash scrolling because the collapsible,
* so we instead need to manually scroll to the step when the hash changes
*/
const handleScrollTo = () => {
if (!stepId) {
return
}
const historyItem = document.getElementById(stepId)
if (!historyItem) {
return
}
/**
* Scroll to the step if it's the one we're looking for but
* we need to wait for the collapsible to open before scrolling
*/
setTimeout(() => {
historyItem.scrollIntoView({
behavior: "smooth",
block: "end",
})
}, 100)
}
return (