
import React from 'react'
import DashBody from '../../Layout/Dashboard/DashBody'
import DashHeader from '../../Layout/Dashboard/DashHeader'
import LyTable from '../../Layout/Dashboard/LyTable'
import useTableColumns from './useTableColumns'
import { useGetWorks} from '../../api/works'
import { QueryStatusEnum } from '../../config/QueryStatus'
import EditWorksModal from './EditWorksModal'
import AddWorksModal from './AddWorksModal'

function WorksPage() {

    const column   =useTableColumns()
    const {data  ,status } = useGetWorks()

    
  return (
    // Pass Status to Layout 
    <DashBody status={status as QueryStatusEnum} >
      <DashHeader title={'Works'}></DashHeader>
      
      <LyTable
        data={data}
        isLoading={false}
        columns={column}
      />
      
      <EditWorksModal />
      <AddWorksModal />
      
    </DashBody>
  )
}

export default WorksPage

