import React from 'react'
import { createModalHook, ModalStore } from './src'
import ClientDetail from '@/pages/Customer/Client/components/ClientDetail'
import CompanyDetail from '@/pages/Customer/Company/components/CompanyDetail'
import ConnectCompany from '@/pages/Customer/Company/components/ConnectCompany'
import AddClient from '@/pages/Customer/Client/components/AddClient'
import AddCompany from '@/pages/Customer/Company/components/AddCompany'
import EmployeeDetail from '@/pages/Hr/Employee/components/EmployeeDetail'
import StaffModal from '@/pages/Hr/Employee/components/StaffModal'
import AddBusiness from '@/pages/Customer/Business/components/AddBusiness'
import BusinessDetail from '@/pages/Customer/Business/components/BusinessDetail'
import ReminderList from '@/pages/Workbench/Dashboard/components/ReminderList'
import RatioPanels from '@/pages/Workbench/Dashboard/components/RatioPanels'
import SoftwareDetail from '@/pages/Product/Lock/LockStore/components/SoftwareDetail'
import AddRecord from '@/pages/Customer/Client/components/ClientDetail/AddRecord'
import OpreateLock from '@/pages/Product/Lock/LockStore/components/LockDetail/OpreateLock'
import LockDetail from '@/pages/Product/Lock/LockStore/components/LockDetail'
import ConnectClient from '@/pages/Customer/Client/components/ConnectClient'
import ReceiveLock from '@/pages/Product/Lock/LockStore/components/ReceiveLock'
import CustomPerm from '@/pages/Customer/Company/components/CustomPerm'
import MessageDetail from '@/pages/Hr/Notification/components/MessageDetail'
import CloudDetail from '@/pages/Product/Cloud/components/Detail'
import PersonalDetail from '@/pages/Product/Road/Personal/components/Detail'
import EnterpriseDetail from '@/pages/Product/Road/Enterprise/components/Detail'
import AddEnterprise from '@/pages/Product/Road/Enterprise/components/AddEnterprise'
const modalMap = {
  M_CLIENT_ADD: AddClient, // 添加客户弹窗
  M_COMPANY_ADD: AddCompany, // 添加单位弹窗
  M_BUSINESS_ADD: AddBusiness, // 添加商机弹窗
  D_CLIENT_DETAIL: ClientDetail, // 客户详情抽屉
  D_COMPANY_DETAIL: CompanyDetail, // 单位详情抽屉
  D_BUSINESS_DETAIL: BusinessDetail, // 商机详情抽屉
  M_CONNECT_CLIENT: ConnectClient, // 关联客户弹窗
  M_CONNECT_COMPANY: ConnectCompany, // 关联单位弹窗
  D_EMPLOYEE_DETAIL: EmployeeDetail, // 部门与员工详情抽屉
  M_CONNECT_STAFF: StaffModal, // 关联员工弹窗
  M_REMINDER_LIST: ReminderList, // 仪表盘提醒列表弹窗
  M_RATIO_PANELS: RatioPanels, // 仪表盘环比数据弹窗
  D_LOCK_DETAIL: LockDetail, // 锁库详情抽屉
  D_SOFTWARE_DETAIL: SoftwareDetail, // 软件锁详情抽屉
  M_RECORD_ADD: AddRecord, // 添加服务记录
  M_OPREATE_LOCK: OpreateLock, // 操作锁库弹窗
  M_RECEIVE_LOCK: ReceiveLock, // 接受锁库弹窗
  M_CUSTOM_PERM: CustomPerm, // 自定义数据权限弹窗
  D_NOTICE_DETAIL: MessageDetail, // 通知详情
  D_CLOUD_DETAIL: CloudDetail, // 云版详情
  D_PERSONAL_DETAIL: PersonalDetail, // 大司空2.0个人版详情
  D_ENTERPRISE_DETAIL: EnterpriseDetail, // 大司空2.0企业版详情
  M_ENTERPRISE_ADD: AddEnterprise // 大司空2.0企业版添加企业
}

export const useModal = createModalHook<typeof modalMap>()

export default ({ children }: { children: React.ReactChildren }) => (
  <ModalStore modalMap={modalMap} destroyOnClose="afterClose">
    {children}
  </ModalStore>
)
