90 lines
4.0 KiB
TypeScript
90 lines
4.0 KiB
TypeScript
// import type { FC } from 'react'
|
|
// import type { Order } from '../types/Types'
|
|
// import { formatPrice, formatFaNumber } from '@/helpers/func'
|
|
|
|
// interface OrderSummaryProps {
|
|
// order: Order
|
|
// variant?: 'default' | 'compact'
|
|
// }
|
|
|
|
// const OrderSummary: FC<OrderSummaryProps> = ({ order, variant = 'default' }) => {
|
|
// const isCompact = variant === 'compact'
|
|
|
|
// return (
|
|
// <div className={`space-y-3 ${isCompact ? '' : 'text-[13px]'}`}>
|
|
// <div className={`flex justify-between items-center ${isCompact ? 'border-b border-border border-dashed pb-4' : 'mt-4 border-b border-border border-dashed pb-4'}`}>
|
|
// <div className='text-description'>جمع آیتمها</div>
|
|
// <div>{formatPrice(order.subTotal)}</div>
|
|
// </div>
|
|
|
|
// {order.totalDiscount > 0 && (
|
|
// <div className='space-y-3'>
|
|
// {order.itemsDiscount > 0 && (
|
|
// <div className='flex justify-between items-center'>
|
|
// <div className='text-description font-medium'>تخفیفها:</div>
|
|
// <div className='text-green-600 font-medium'>-{formatPrice(order.itemsDiscount)}</div>
|
|
// </div>
|
|
// )}
|
|
|
|
// {order.couponDiscount > 0 && (
|
|
// <div className='flex justify-between items-center'>
|
|
// <div className='text-description font-medium'>تخفیف کوپن:</div>
|
|
// <div className='text-green-600 font-medium'>-{formatPrice(order.couponDiscount)}</div>
|
|
// </div>
|
|
// )}
|
|
|
|
// <div className='border-t border-border border-dashed pt-3 mt-2'>
|
|
// <div className='flex justify-between items-center'>
|
|
// <div className='font-bold'>جمع تخفیفها:</div>
|
|
// <div className='font-bold text-green-600'>-{formatPrice(order.totalDiscount)}</div>
|
|
// </div>
|
|
// </div>
|
|
// </div>
|
|
// )}
|
|
|
|
// {order.deliveryFee > 0 && (
|
|
// <div className='flex justify-between items-center pt-2'>
|
|
// <div className='text-description'>هزینه ارسال:</div>
|
|
// <div>{formatPrice(order.deliveryFee)}</div>
|
|
// </div>
|
|
// )}
|
|
|
|
// {order.tax > 0 && (
|
|
// <div className='flex justify-between items-center pt-2'>
|
|
// <div className='text-description'>مالیات:</div>
|
|
// <div>{formatPrice(order.tax)}</div>
|
|
// </div>
|
|
// )}
|
|
|
|
// {isCompact && (
|
|
// <>
|
|
// {order.deliveryMethod?.minOrderPrice && (
|
|
// <div className='flex justify-between items-center border-b border-border border-dashed pb-4'>
|
|
// <div className='text-description'>حداقل سفارش:</div>
|
|
// <div>{formatPrice(order.deliveryMethod.minOrderPrice)}</div>
|
|
// </div>
|
|
// )}
|
|
|
|
// <div className='flex justify-between items-center border-b border-border border-dashed pb-4'>
|
|
// <div className='text-description'>تعداد آیتمها:</div>
|
|
// <div>{formatFaNumber(order.totalItems)}</div>
|
|
// </div>
|
|
// </>
|
|
// )}
|
|
|
|
// <div className={`flex font-bold justify-between items-center ${isCompact ? '' : 'h-14 border-t-2 border-gray-300 pt-3 mt-3'}`}>
|
|
// <div>جمع کل:</div>
|
|
// <div className={`${isCompact ? 'text-base' : 'text-lg'}`}>{formatPrice(order.total)}</div>
|
|
// </div>
|
|
// </div>
|
|
// )
|
|
// }
|
|
|
|
// export default OrderSummary
|
|
|
|
|
|
const OrderSummary = () => {
|
|
return null
|
|
}
|
|
|
|
export default OrderSummary |