import React from "react";
import { ImageLayerOfCommentHOC } from "../modules/page/layers/ImageLayerOfCommentHOC";
import { Route, Switch, withRouter } from "react-router";
import { SnackbarHOC } from "educoder";
import { CNotificationHOC } from "../modules/courses/common/CNotificationHOC";
import { TPMIndexHOC } from "../modules/tpm/TPMIndexHOC";
import Loadable from 'react-loadable';
import Loading from "../Loading";

const SoftBotDetail = Loadable({
  loader : () => import("./softBotDetail"),
  loading: Loading,
})
const SoftBotList = Loadable({
  loader : () => import("./softBotList"),
  loading: Loading,
})

function SoftBot(props){
  return <div>
    <Switch {...props}>
      <Route
        path="/softbot/:id"
        render={(p) => (
          <SoftBotDetail {...props} {...p} />
        )}
      ></Route>
      <Route
        path="/softbot"
        render={(p) => (
          <SoftBotList {...props} {...p} />
        )}
      ></Route>
    </Switch>
  </div>
}
export default withRouter(
  ImageLayerOfCommentHOC({
    imgSelector: ".imageLayerParent img, .imageLayerParent .imageTarget",
    parentSelector: ".newMain",
  })(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(SoftBot))))
);