import React from "react"
import loadable from "@loadable/component"
import * as antd from "antd"
const DebuggersComponentsPaths = {
...import.meta.glob("/src/debug/components/**/[a-z[]*.jsx"),
...import.meta.glob("/src/debug/components/**/[a-z[]*.tsx")
}
class DebuggerRender extends React.PureComponent {
state = {
error: null,
}
componentDidCatch(error, info) {
console.error(error, info)
this.setState({ error })
}
render() {
const { renderFile } = this.props
if (this.state.error) {
return
Something went wrong
{this.state.error.toString()}
}
return React.createElement(loadable(renderFile, { fallback: Loading...
}))
}
}
export default (props) => {
const [activeDebuggerFile, setActiveDebugger] = React.useState(null)
const handleDebbugerSelect = (key) => {
setActiveDebugger(key)
}
if (activeDebuggerFile) {
const DebuggerFile = DebuggersComponentsPaths[activeDebuggerFile]
return
setActiveDebugger(null)}>
Back
}
return
Select a debugger
{
Object.keys(DebuggersComponentsPaths).map((key, index) => {
return
})
}
}