import React from 'react'
import styles from './index.module.scss'
import { baseFormData, topSearch } from '@/pages/Zother/data'
import { useSelector } from 'react-redux'
import { RootState } from '@/store'
import TableList from '@/pages/Zother/TableList'
import { G1_APIgetList } from '@/store/action/Gmaintain/G1accident'
import { baseTableC } from '@/utils/tableData'

const search = topSearch('事故')

const baseFormDataRes = baseFormData()

function G1accident() {
  // 从仓库拿数据
  const tableInfo = useSelector((state: RootState) => state.G1accident.tableInfo)

  return (
    <div className={styles.G1accident}>
      <div className='pageTitle'>事故登记</div>
      <TableList
        baseFormData={baseFormDataRes}
        getListAPI={G1_APIgetList}
        pageKey='accident'
        tableInfo={tableInfo}
        columnsTemp={baseTableC('事故')}
        yHeight={585}
        searchDom={search}
      />
    </div>
  )
}

const MemoG1accident = React.memo(G1accident)

export default MemoG1accident
