
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 { useGetContact} from '../../api/Contact'
import { QueryStatusEnum } from '../../config/QueryStatus'
import EditContactModal from './EditContactModal'
import AddContactModal from './AddContactModal'

function ContactPage() {

    const column   =useTableColumns()
    const {data  ,status } = useGetContact(
      {
        pagination:true
      }
    )  
    
  return (
    // Pass Status to Layout 
    <DashBody status={status as QueryStatusEnum} >
      <DashHeader title={'Contact'} showAddButton={false}></DashHeader>
      
      <LyTable
        data={data?.data}
        isLoading={false}
        columns={column}  
        is_pagination
        total={data?.meta?.total}
      />
      
      
      <EditContactModal />
      <AddContactModal />
      
    </DashBody>
  )
}

export default ContactPage

