diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2025-06-16 02:05:40 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2025-06-16 02:05:40 +0000 |
| commit | 755163a9f803e6959afb4568baa55538b9628cab (patch) | |
| tree | 4469b0d7c6e8b2a7185b271d9589e8de4724d4f2 /src/lib/transaction/components/Transaction.jsx | |
| parent | 5669295b8cff1a9c9e559dd263599123a2ad6e92 (diff) | |
| parent | 8ca6c0aa1b2a578332ff1c3706f58530f549352e (diff) | |
Merged in biteship-merge (pull request #420)
Biteship merge
Diffstat (limited to 'src/lib/transaction/components/Transaction.jsx')
| -rw-r--r-- | src/lib/transaction/components/Transaction.jsx | 161 |
1 files changed, 110 insertions, 51 deletions
diff --git a/src/lib/transaction/components/Transaction.jsx b/src/lib/transaction/components/Transaction.jsx index 709fa5d4..8b3a8dd0 100644 --- a/src/lib/transaction/components/Transaction.jsx +++ b/src/lib/transaction/components/Transaction.jsx @@ -41,6 +41,8 @@ import { useRouter } from 'next/router'; import { gtagPurchase } from '@/core/utils/googleTag'; import { deleteItemCart } from '@/core/utils/cart'; import axios from 'axios'; +import InformationSection from '../../treckingAwb/component/InformationSection'; +import { Button } from '@chakra-ui/react'; const Transaction = ({ id }) => { const PPN = process.env.NEXT_PUBLIC_PPN; const router = useRouter(); @@ -443,6 +445,8 @@ const Transaction = ({ id }) => { <span className='mt-2 font-medium'> No Resi : {airway?.trackingNumber || '-'}{' '} </span> + {/*biteship*/} + {/*<p className='mt-1 font-medium'>{airway?.name}</p>*/} </div> <div className='flex gap-x-2'> <div className='text-sm text-gray-600 badge-green leading-[1.5] mt-1 text-center'> @@ -622,19 +626,25 @@ const Transaction = ({ id }) => { )} </div> - <div className='flex items-center justify-between mb-3'> - <div className='flex items-center gap-x-2'> - <span className='text-h-sm font-medium'> - {transaction?.data?.name} - </span> - <TransactionStatusBadge status={transaction?.data?.status} /> - </div> - <div className='text-h-sm'> - Estimasi Barang Siap:{' '} - <span className='text-red-500 font-semibold'> - {transaction?.data?.expectedReadyToShip} - </span> - </div> + {/*new-release*/} + {/*<div className='flex items-center justify-between mb-3'>*/} + {/* <div className='flex items-center gap-x-2'>*/} + {/* <span className='text-h-sm font-medium'>*/} + {/* {transaction?.data?.name}*/} + {/* </span>*/} + {/* <TransactionStatusBadge status={transaction?.data?.status} />*/} + {/* </div>*/} + {/* <div className='text-h-sm'>*/} + {/* Estimasi Barang Siap:{' '}*/} + {/* <span className='text-red-500 font-semibold'>*/} + {/* {transaction?.data?.expectedReadyToShip}*/} + {/* </span>*/} + {/* </div>*/} + <div className='flex items-center gap-x-2 mb-3'> + <span className='text-h-sm font-medium'> + {transaction?.data?.name} + </span> + <TransactionStatusBadge status={transaction?.data?.status} /> </div> <div className='flex gap-x-4'> <button @@ -746,54 +756,103 @@ const Transaction = ({ id }) => { </div> </div> - <div className='text-h-sm font-semibold mt-10 mb-4'> - Informasi Pelanggan - </div> - <div className='grid grid-cols-2 gap-x-4'> - <div className='border border-gray_r-6 rounded p-3'> - <div className='font-medium mb-4'>Detail Pelanggan</div> - <SectionContent - address={transaction?.data?.address?.customer} - /> + <div className='flex gap-x-3'> + <div className='w-1/2'> + <div className='text-h-sm font-semibold mt-10 mb-4'> + Informasi Pelanggan + </div> + <div className='border border-gray_r-6 rounded p-3'> + <div className='font-medium mb-4'>Detail Pelanggan</div> + <SectionContent + address={transaction?.data?.address?.customer} + /> + </div> </div> - </div> - <div className='flex '> <div className='w-1/2'> <div className='text-h-sm font-semibold mt-10 mb-4'> - Pengiriman + Informasi Pengiriman </div> {transaction?.data?.pickings.length == 0 && ( <div className='badge-red text-sm'> Belum ada pengiriman </div> )} - <div className='grid grid-cols-1 gap-1 w-2/3'> - {transaction?.data?.pickings?.map((airway) => ( - <button - className='shadow rounded-md p-3 text-gray_r-12 font-normal flex justify-between items-center text-left h-20' - key={airway?.id} - onClick={() => setIdAWB(airway?.id)} - > - <div> - <p className='text-sm text-gray_r-11'> - {airway?.name} - </p> - <span className='text-md text-bold mt-1'> - No Resi : {airway?.trackingNumber || '-'}{' '} - </span> - </div> - <div className='flex gap-x-2'> - <div className='text-sm text-gray-600 badge-green leading-[1.5] mt-1 text-center'> - {airway?.delivered - ? 'Pesanan Tiba' - : 'Sedang Dikirim'} - </div> - <ChevronRightIcon className='w-5 stroke-2' /> - </div> - </button> - ))} - </div> + {/* <div className='grid grid-cols-1 gap-1 w-1/2'> */} + {transaction?.data?.pickings?.map((airway) => ( + <div + key={airway?.id} + className='border border-gray_r-6 rounded p-3' + > + <InformationSection manifests={airway} /> + <div className='p-4'> + <button + className='bg-transparent text-red-600 hover:underline p-0 font-semibold' + onClick={() => { + if (airway?.waybillNumber == '-') { + toast.error('Nomor Resi belum tersedia'); + return; + } + setIdAWB(airway.id); + }} + > + Lacak Pengiriman + </button> + </div> + </div> + // <button + // className='shadow rounded-md p-3 text-gray_r-12 font-normal flex justify-between items-center text-left h-20' + // key={airway?.id} + // onClick={() => setIdAWB(airway?.id)} + // > + // <div> + // <span className='text-sm text-gray_r-11'> + // No Resi : {airway?.trackingNumber || '-'}{' '} + // </span> + // <p className='mt-1 font-medium'>{airway?.name}</p> + // </div> + // <div className='flex gap-x-2'> + // <div className='text-sm text-gray-600 badge-green leading-[1.5] mt-1'> + // {airway?.delivered + // ? 'Pesanan Tiba' + // : 'Sedang Dikirim'} + // </div> + // <ChevronRightIcon className='w-5 stroke-2' /> + // </div> + // </button> + ))} + {/* </div> */} </div> + </div> + + <div className='flex '> + {/*New release*/} + {/* <div className='grid grid-cols-1 gap-1 w-2/3'>*/} + {/* {transaction?.data?.pickings?.map((airway) => (*/} + {/* <button*/} + {/* className='shadow rounded-md p-3 text-gray_r-12 font-normal flex justify-between items-center text-left h-20'*/} + {/* key={airway?.id}*/} + {/* onClick={() => setIdAWB(airway?.id)}*/} + {/* >*/} + {/* <div>*/} + {/* <p className='text-sm text-gray_r-11'>*/} + {/* {airway?.name}*/} + {/* </p>*/} + {/* <span className='text-md text-bold mt-1'>*/} + {/* No Resi : {airway?.trackingNumber || '-'}{' '}*/} + {/* </span>*/} + {/* </div>*/} + {/* <div className='flex gap-x-2'>*/} + {/* <div className='text-sm text-gray-600 badge-green leading-[1.5] mt-1 text-center'>*/} + {/* {airway?.delivered*/} + {/* ? 'Pesanan Tiba'*/} + {/* : 'Sedang Dikirim'}*/} + {/* </div>*/} + {/* <ChevronRightIcon className='w-5 stroke-2' />*/} + {/* </div>*/} + {/* </button>*/} + {/* ))}*/} + {/* </div>*/} + {/*</div>*/} <div className='invoice w-1/2 '> <div className='text-h-sm font-semibold mt-10 mb-4 '> Invoice |
