detail product fix status text

This commit is contained in:
hamid zarghami
2025-11-06 10:16:09 +03:30
parent e50206bca4
commit bcb6472a60
4 changed files with 21 additions and 26 deletions
+13
View File
@@ -1,3 +1,4 @@
import { OrdersStatus } from "@/app/profile/orders/types/Types";
import { TOKEN_NAME, REFRESH_TOKEN_NAME } from "./const";
export function isEmail(input: string): boolean {
@@ -156,3 +157,15 @@ export function limitHtmlWords(htmlString: string, wordLimit: number): string {
return result;
}
export const getStatusText = (status: string) => {
const statusMap: { [key: string]: string } = {
[OrdersStatus.wait_payment]: "در انتظار پرداخت",
[OrdersStatus.process_by_seller]: "در حال پردازش",
[OrdersStatus.shipped]: "در حال ارسال",
[OrdersStatus.Delivered]: "تحویل شده",
[OrdersStatus.Cancelled]: "لغو شده",
[OrdersStatus.cancelled_system]: "لغو شده توسط سیستم",
};
return statusMap[status] || status;
};