import React, { useState, useEffect, useRef } from 'react';


export default function Index(props) {
  const [show, setShow] = useState(false);
  const CronEditor = useRef();
  useEffect(() => {
    import('./antd-cron-editor').then((res) => {
      CronEditor.current = res;
      setShow(true);
    });
  }, []);

  if (!show) {
    return null;
  } else {
    const CronComponent = CronEditor.current;
    return (
      <CronComponent style={{ width: 600 }} {...props} />
    );
  }
}
