import { Cron as ReactCron } from 'react-js-cron';
import 'react-js-cron/dist/styles.css';
import en from './en';
import zh from './zh';
import { useControllableValue } from 'ahooks';
import { memo } from 'react';
// import { ProFormText } from '@ant-design/pro-form';
import { getLocale } from 'umi';
const CustomCron = (props) => {
  const [state, setState] = useControllableValue(props);
  return (
    <>
      {/* <ProFormText
        fieldProps={{
          value: state,
          onChange: (event) => {
            setState(event.target.value);
          },
        }}
      /> */}
      <ReactCron
        locale={getLocale() === 'zh-CN' ? zh : en}
        value={state}
        setValue={(newValue: string) => {
          setState(newValue);
        }}
      />
    </>
  );
};
export default memo(CustomCron);
