
import DashBody from '../../../Layout/Dashboard/DashBody'
import DashHeader from '../../../Layout/Dashboard/DashHeader'
import LyTable from '../../../Layout/Dashboard/LyTable'
import useTableColumns from './useTableColumns'
import { QueryStatusEnum } from '../../../config/QueryStatus'
import {  useParams } from 'react-router-dom'
import { useGetOneOrder } from '../../../api/order'
import { Spin } from 'antd'

function ProductsPage() {

    const column   =useTableColumns()
    const {id} = useParams()
    const { data, status,isLoading } = useGetOneOrder({id: id })
    const order = data?.data || {};
  const items = order?.products ;
  if(isLoading){
    return <Spin/>
  }

  console.log(items,"items");
  
  return (
    <DashBody status={status as QueryStatusEnum} >
    <DashHeader showAddButton={false} title={'products'}>
  
    </DashHeader>
      
      <LyTable
        data={items}
        isLoading={false}
        columns={column}
        is_pagination={false}
        
    />
      
    
    </DashBody>
  )
}

export default ProductsPage

