diff --git a/src/app/[name]/(Main)/order/history/page.tsx b/src/app/[name]/(Main)/order/history/page.tsx index 1e6463b..a4f9cc8 100644 --- a/src/app/[name]/(Main)/order/history/page.tsx +++ b/src/app/[name]/(Main)/order/history/page.tsx @@ -5,7 +5,7 @@ import CalendarIcon from '@/components/icons/CalendarIcon'; import LocationPinIcon from '@/components/icons/LocationPinIcon'; import TabContainer from '@/components/tab/TabContainer' import { TabHeader } from '@/components/tab/TabHeader'; -import { Receipt2, ReceiptItem } from 'iconsax-react'; +import { Receipt2, ReceiptItem, DocumentText, TickCircle } from 'iconsax-react'; import Image from 'next/image'; import Link from 'next/link'; import React, { useMemo, useState } from 'react' @@ -39,6 +39,21 @@ const formatDate = (dateString: string): string => { }); }; +const getStatusColor = (status: string): string => { + const statusMap: Record = { + 'pendingPayment': 'text-yellow-600 dark:text-yellow-400', + 'paid': 'text-green-600 dark:text-green-400', + 'preparing': 'text-blue-600 dark:text-blue-400', + 'deliveredToWaiter': 'text-purple-600 dark:text-purple-400', + 'deliveredToReceptionist': 'text-indigo-600 dark:text-indigo-400', + 'shipped': 'text-cyan-600 dark:text-cyan-400', + 'completed': 'text-green-600 dark:text-green-400', + 'canceled': 'text-red-600 dark:text-red-400', + 'cancelled': 'text-red-600 dark:text-red-400', + }; + return statusMap[status] || 'text-gray-600 dark:text-gray-400'; +}; + function OrdersIndex() { const { t } = useTranslation('orders'); @@ -67,7 +82,16 @@ function OrdersIndex() { return (
-
+
+
+

#{order.orderNumber}

+
+
+ +

{t(`status.${order.status}`)}

+
+
+

{address}

@@ -142,7 +166,17 @@ function OrdersIndex() { return (
-
+
+
+ +

#{order.orderNumber}

+
+
+ +

{t(`status.${order.status}`)}

+
+
+

{address}

diff --git a/src/app/[name]/(Main)/order/history/types/Types.ts b/src/app/[name]/(Main)/order/history/types/Types.ts index 9f4ff8c..7841eb2 100644 --- a/src/app/[name]/(Main)/order/history/types/Types.ts +++ b/src/app/[name]/(Main)/order/history/types/Types.ts @@ -112,7 +112,7 @@ export interface HistoryOrderPaymentMethod { updatedAt: string; deletedAt: string | null; restaurant: string; - method: "CardOnDelivery" | "Cash" | "Online"; + method: "CardOnDelivery" | "Cash" | "Online" | "Wallet"; gateway: string | null; description: string; enabled: boolean;