
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 { useGetProduct} from '../../api/product'
import { QueryStatusEnum } from '../../config/QueryStatus'
import EditProductModal from './EditProductModal'
import AddProductModal from './AddProductModal'

function ProductPage() {

    const column   =useTableColumns()
    const {data  ,status } = useGetProduct(
      {
        pagination:true
      }
    )

    
  return (
    // Pass Status to Layout 
    <DashBody status={status as QueryStatusEnum} >
      <DashHeader title={'Product'}></DashHeader>
      
      <LyTable
        data={data?.data}
        isLoading={false}
        columns={column}  
        is_pagination
        total={data?.meta?.total}
      />
      
      <EditProductModal />
      <AddProductModal />
      
    </DashBody>
  )
}

export default ProductPage

