import { ref } from 'vue'

// import WysiwygEditor from '@/WysiwygEditor.vue'
// // import CodeEditor from '@/CodeEditor.vue'
// import GridSettings from '~/views/GridSettings.vue'
// import GridView from '~/views/GridView.vue'
// import TableView from '~/views/TableView.vue'
// import ListView from '~/views/ListView.vue'
// import FormView from '~/views/FormView.vue'

// import TaFormView from '/app_modules/bm/ta/views/ta_form.vue'
// import TaTableView from '/app_modules/bm/ta/views/ta_table.vue'
// import TaListView from '/app_modules/bm/ta/views/ta_list.vue'

export enum DynComponent {
  // GridSettings,
  // GridJs,
  // TableView,
  // ListView,
  // FormView,
  // WysiwygEditor,
//   CodeEditor,
}

const asideComponent = ref({})

const settingsComponent = ref({})

const fullSliderComponent = ref({})

const formViewComponent = ref({})

const dataViewComponent = ref({})

const topPaneComponent = ref({})

const bottomPaneComponent = ref({})

const moduleComponent = ref({})

const getModuleComponent = (key: string, target: string): any => {
  // switch (key) {
  //   case 'ta':
  //     switch (target) {
  //       case 'form':
  //         return TaFormView
  //         break
  //       case 'table':
  //         return TaTableView
  //         break
  //       case 'list':
  //         return TaListView
  //         break
  //     }
  //     break
  // }
}
const getComponent = (cmpnt: DynComponent): any => {
  // switch (cmpnt) {
  //   case DynComponent.WysiwygEditor:
  //     return WysiwygEditor
  //     break
  //   // case DynComponent.CodeEditor:
  //   //   return CodeEditor
  //   //   break
  //   case DynComponent.GridSettings:
  //     return GridSettings
  //     break
  //   case DynComponent.GridJs:
  //     return GridView
  //     break
  //   case DynComponent.TableView:
  //     return TableView
  //     break
  //   case DynComponent.ListView:
  //     return ListView
  //     break
  //   case DynComponent.FormView:
  //     return FormView
  //     break
  // }
}

export default function useComponent() {
  return {
    getModuleComponent,
    asideComponent,
    settingsComponent,
    fullSliderComponent,
    dataViewComponent,
    formViewComponent,
    getComponent,
    topPaneComponent,
    bottomPaneComponent,
    moduleComponent,
  }
}
