card owner
Build and Deploy Docker Images / build_and_deploy (push) Has been cancelled

This commit is contained in:
hamid zarghami
2026-06-15 12:56:22 +03:30
parent 2229c13784
commit 2b211b5b1a
4 changed files with 76 additions and 1 deletions
@@ -1,6 +1,7 @@
'use client';
import { useParams, useRouter } from 'next/navigation';
import Image from 'next/image';
import React from 'react';
import Button from '@/components/button/PrimaryButton';
import { Skeleton } from '@/components/ui/skeleton';
@@ -29,6 +30,11 @@ const getDeliveryMethodTitle = (method: string) => {
}
};
const getPaymentMethodTitle = (method: string, fallback?: string) => {
const methodKey = method as keyof typeof ordersTranslations.paymentMethod;
return ordersTranslations.paymentMethod[methodKey] || fallback || 'نامشخص';
};
// const getStatusPercentage = (status: string) => {
// switch (status) {
// case 'new':
@@ -164,6 +170,46 @@ function OrderTrackingPage() {
</div>
)}
{orderDetail.data.paymentMethod && (
<div className='flex justify-between items-center h-16 border-b border-border'>
<span className='text-sm text-muted-foreground'>نوع پرداخت</span>
<span className='text-sm font-semibold'>
{getPaymentMethodTitle(
orderDetail.data.paymentMethod.method,
orderDetail.data.paymentMethod.description
)}
</span>
</div>
)}
{orderDetail.data.payments?.[0]?.description?.trim() && (
<div className='py-3 border-b border-border'>
<div className='text-sm text-muted-foreground mb-1'>توضیحات پرداخت</div>
<div className='text-sm'>{orderDetail.data.payments[0].description}</div>
</div>
)}
{orderDetail.data.payments?.[0]?.attachments?.length ? (
<div className='py-3 border-b border-border'>
<div className='text-sm text-muted-foreground mb-2'>پیوست پرداخت</div>
<div className='flex flex-col gap-2'>
{orderDetail.data.payments[0].attachments.map((attachment, index) => (
<div
key={attachment}
className='relative w-full h-40 rounded-normal overflow-hidden border border-border'
>
<Image
src={attachment}
alt={`پیوست پرداخت ${index + 1}`}
fill
className='object-contain'
/>
</div>
))}
</div>
</div>
) : null}
<div className='flex justify-between items-center py-4 border-t border-border'>
<span className='text-sm font-medium'>مجموع سفارش</span>
<span className='text-sm font-bold '>