Files
pos-dashboard-v2/src/views/apps/ecommerce/orders/details/index.tsx
T

59 lines
1.4 KiB
TypeScript
Raw Normal View History

2025-08-10 15:47:04 +07:00
'use client'
2025-08-05 12:35:40 +07:00
// MUI Imports
import Grid from '@mui/material/Grid2'
// Type Imports
// Component Imports
2025-08-10 15:47:04 +07:00
import { redirect, useParams } from 'next/navigation'
import Loading from '../../../../../components/layout/shared/Loading'
import { useOrder } from '../../../../../services/queries/orders'
import BillingAddress from './BillingAddressCard'
import CustomerDetails from './CustomerDetailsCard'
2025-08-05 12:35:40 +07:00
import OrderDetailHeader from './OrderDetailHeader'
import OrderDetailsCard from './OrderDetailsCard'
import ShippingAddress from './ShippingAddressCard'
2025-08-10 15:47:04 +07:00
const OrderDetails = () => {
const params = useParams()
const { data, isLoading } = useOrder(params.id as string)
if (isLoading) {
return <Loading />
}
if (!data) {
redirect('not-found')
}
2025-08-05 12:35:40 +07:00
return (
<Grid container spacing={6}>
<Grid size={{ xs: 12 }}>
2025-08-10 15:47:04 +07:00
<OrderDetailHeader orderData={data} />
2025-08-05 12:35:40 +07:00
</Grid>
<Grid size={{ xs: 12, md: 8 }}>
<Grid container spacing={6}>
<Grid size={{ xs: 12 }}>
2025-08-10 15:47:04 +07:00
<OrderDetailsCard data={data} />
2025-08-05 12:35:40 +07:00
</Grid>
</Grid>
</Grid>
<Grid size={{ xs: 12, md: 4 }}>
<Grid container spacing={6}>
<Grid size={{ xs: 12 }}>
2025-08-10 15:47:04 +07:00
<CustomerDetails orderData={data} />
2025-08-05 12:35:40 +07:00
</Grid>
<Grid size={{ xs: 12 }}>
2025-08-10 15:47:04 +07:00
<BillingAddress data={data} />
2025-08-05 12:35:40 +07:00
</Grid>
</Grid>
</Grid>
</Grid>
)
}
export default OrderDetails