@@ -262,15 +256,15 @@ const OrderDetailsCard = () => {
Subtotal:
- $2,093
+ {formatCurrency(data.subtotal)}
- Shipping Fee:
+ Discount
- $2
+ {formatCurrency(data.discount_amount)}
@@ -278,7 +272,7 @@ const OrderDetailsCard = () => {
Tax:
- $28
+ {formatCurrency(data.tax_amount)}
@@ -286,7 +280,7 @@ const OrderDetailsCard = () => {
Total:
- $2113
+ {formatCurrency(data.total_amount)}
diff --git a/src/views/apps/ecommerce/orders/details/index.tsx b/src/views/apps/ecommerce/orders/details/index.tsx
index 529a931..efc8883 100644
--- a/src/views/apps/ecommerce/orders/details/index.tsx
+++ b/src/views/apps/ecommerce/orders/details/index.tsx
@@ -1,43 +1,59 @@
+'use client'
+
// MUI Imports
import Grid from '@mui/material/Grid2'
// Type Imports
-import type { OrderType } from '@/types/apps/ecommerceTypes'
// Component Imports
+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'
import OrderDetailHeader from './OrderDetailHeader'
import OrderDetailsCard from './OrderDetailsCard'
-import ShippingActivity from './ShippingActivityCard'
-import CustomerDetails from './CustomerDetailsCard'
import ShippingAddress from './ShippingAddressCard'
-import BillingAddress from './BillingAddressCard'
-const OrderDetails = ({ orderData, order }: { orderData?: OrderType; order: string }) => {
+const OrderDetails = () => {
+
+ const params = useParams()
+
+ const { data, isLoading } = useOrder(params.id as string)
+
+ if (isLoading) {
+ return