import { useQuery } from '@tanstack/react-query'; import exchanges_api from 'api/exchanges'; import * as React from 'react'; import { useTranslation } from 'react-i18next'; import { Dimensions, ScrollView, Text, View } from 'react-native'; import Svg, { Circle, Path } from 'react-native-svg'; import Plane from 'svg/Plane'; import { PaymentStyle } from '../../payment/ui/style'; interface PaymentProductProps { packet: any; } const PaymentProduct = ({ packet }: PaymentProductProps) => { const { t } = useTranslation(); const screenWidth = Dimensions.get('window').width; const isSmallScreen = screenWidth < 380; const svgWidth = screenWidth * 0.8; const { data } = useQuery({ queryKey: ['exchanges'], queryFn: () => exchanges_api.getExchanges(), }); return ( {data && ( <> {data[0].code} {data[0].rate} UZS )} Cargo 12.267 UZS/ kg {/* {t('Yetkazish vaqti')} 08.25.2025 */} Reys {packet.packetName} {packet.items.map((item: any, index: number) => { const price = Number(item.price); const weight = Number(item.weight); const total = price * weight; // formatlash: 0 decimal, so‘m bilan const formattedPrice = price.toFixed(0); const formattedTotal = total.toFixed(0); return ( {item.name} {t('Trek ID')}: {item.trackId} {t('Og’irligi')}: {weight} kg 1kg * {formattedPrice} {t('so‘m')} {t('Umumiy narxi')}: {formattedTotal} {t('so‘m')} ); })} {t('Umumiy narxi')} {packet.totalPrice} ); }; export default PaymentProduct;