import IDCard from "./components/DoubleUploadImg/DoubleUploadImg";
import DoubleUploadImg from "./components/DoubleUploadImg/DoubleUploadImg";
import InputWapper from './components/input/input';
import SwitchWapper from './components/switch/switch';
import SelectWapper from './components/select/select';
import PasswordWapper from './components/password/password';
import DigitWapper from './components/digit/digit';
import MoneyWapper from './components/money/money';
import TextareaWapper from './components/textarea/textarea';
import DateWapper from './components/date/date';
import DateRangeWapper from './components/dateRange/dateRange';
import ColorPicker from "./components/ColorPicker/index";
import BankCardNumber from "./components/BankCardNumber/BankCardNumber";
import InputSearchWapper from "./components/inputSearch/inputSearch"
import UploadImg from "./components/UploadImg/UploadImg";
import GroupWapper from "./components/Group/group";
import TableWapper from "./components/TableWapper/TableWapper"
import ModalWapper from "./components/ModalWapper/modal"
import RadioWapper from "./components/Radio/Radio";
import BottomSubButton from "./components/BottomSubButton/BottomSubButton";
import Mobile from "./components/mobileWapper/mobile"
import DateTimeWapper from "./components/dateTime/dateTime"
import DateTimeRangeWapper from "./components/dateTimeRange/dateTimeRange"
import Checkbox from "./components/Checkbox"
import React from "react";
// import { ConfigProvider } from 'antd';
// import zhCn from 'antd/es/locale/zh_CN';


const GetComUi = (item: any) => {
  if (item?.valueType === '@custom') {
    return item.content
  }
  switch (item.valueType) {
    case 'checkbox':
      return <Checkbox {...item} />
    case 'text':
      return <InputWapper {...item} />;
    case 'switch':
      return <SwitchWapper {...item} />;
    case 'select':
      return <SelectWapper {...item} />;
    case 'password':
      return <PasswordWapper {...item} />;
    case 'digit':
      return <DigitWapper {...item} />;
    case "radio":
      return <RadioWapper {...item} />;
    case 'money':
      return <MoneyWapper {...item} />;
    case 'textarea':
      return <TextareaWapper {...item} />;
    case 'date':
      return <DateWapper {...item} />;
    case 'dateRange':
      return <DateRangeWapper {...item} />;
    case "dateTime":
      return <DateTimeWapper {...item} />;
    case "dateTimeRange":
      return <DateTimeRangeWapper {...item} />;
    case "mobile":
      return <Mobile {...item} />;
    case "inputSearch":
      return <InputSearchWapper {...item} />;
    case 'IDCard':
      return <IDCard {...item} />;
    case "DoubleUploadImg":
      return <DoubleUploadImg {...item} />;
    case 'BankCardNumber':
      return <BankCardNumber {...item} />;
    case "UploadImg":
      return <UploadImg {...item} />;
    // 111
    case "@group":
      return <GroupWapper {...item} />;
    case "table":
      return <TableWapper {...item} />;
    case "modal":
      return <ModalWapper {...item} />;
    case "BottomSubButton":
      return <BottomSubButton {...item} />;
    case "ColorPicker":
      return <ColorPicker {...item} />;
    default:
      return null;
  }
};

export const getComUi = (item: any) => {
  // return <ConfigProvider locale={zhCn} >
  //   {GetComUi(item)}
  // </ConfigProvider>
  return GetComUi(item)
}
