import { ProDescriptions } from '@ant-design/pro-components';
import { Divider } from 'antd';
import React, { useState, useEffect } from 'react';
const DetailNode = (props) => {
  const { data, index, columns, hasTable = false, operationType } = props;
  console.log(props);
  return (
    <>
      <div className="fault-detail">
        <div style={{ flex: 1, display: 'flex', flexDirection: 'row' }}>
          <div className="fault-index">{Number(index) + 1}</div>
          <div style={{ display: 'flex', flexDirection: 'column' }}>
            <label style={{ width: '80px', fontSize: 18, fontWeight: 600 }}>
              {data?.operationTypeName}
            </label>
            <span>{data?.updateUserName}</span>
            <span>{data?.updateTime}</span>
          </div>
        </div>
        <div style={{ flex: 6 }}>
          <div>
            <h2 className="page-title" style={{ marginBottom: 16 }}>
              {operationType == 0 ? '基础信息' : data?.operationTypeName}
            </h2>
          </div>
          <ProDescriptions dataSource={data} columns={columns} />
          {hasTable ? props.children : null}
          <Divider />
        </div>
      </div>
    </>
  );
};

export default DetailNode;
