import { BizDetailLayout } from '@zgfe/business-lib';
import { Tabs } from 'antd';
import React from 'react';
import JobCreator from '../../components/job';
import JobHistory from '../../components/jobHistory';
import TaskContext from './context';
var CdpCreateJob = function CdpCreateJob(props) {
  var mode = props.mode;
  var items = [{
    label: '任务详情',
    key: 'detail',
    children: /*#__PURE__*/React.createElement(JobCreator, {
      onOk: props.onOk,
      onCancel: props.onBack
    })
  }];
  if (mode === 'edit') {
    items.push({
      label: '更新记录',
      key: 'history',
      children: /*#__PURE__*/React.createElement(JobHistory, null)
    });
  }
  return /*#__PURE__*/React.createElement(BizDetailLayout, {
    onBack: props.onBack,
    width: "100%",
    extra: /*#__PURE__*/React.createElement(React.Fragment, null, mode === 'create' ? '新建' : '编辑', "\u6570\u636E\u540C\u6B65")
  }, /*#__PURE__*/React.createElement(TaskContext.Provider, {
    value: {
      mode: props.mode,
      taskId: props.taskId
    }
  }, /*#__PURE__*/React.createElement(Tabs, {
    defaultActiveKey: "detail",
    items: items
  })));
};
export default CdpCreateJob;