From b4a595eaa8600e7bd1bafcef38abe4c01a5b664c Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Wed, 12 Mar 2025 16:59:18 +0700
Subject: <iman> fix transaction

---
 src/lib/transaction/components/Transaction.jsx | 58 ++++++++++++++++----------
 1 file changed, 35 insertions(+), 23 deletions(-)

(limited to 'src/lib/transaction/components/Transaction.jsx')

diff --git a/src/lib/transaction/components/Transaction.jsx b/src/lib/transaction/components/Transaction.jsx
index 07f9573d..8369c425 100644
--- a/src/lib/transaction/components/Transaction.jsx
+++ b/src/lib/transaction/components/Transaction.jsx
@@ -49,7 +49,6 @@ const Transaction = ({ id }) => {
   const [reason, setReason] = useState('');
   const auth = useAuth();
   const { transaction } = useTransaction({ id });
-  console.log('transaction', transaction);
   const statusApprovalWeb = transaction.data?.approvalStep;
   const [isLoading, setIsLoading] = useState(false);
   const { queryAirwayBill } = useAirwayBill({ orderId: id });
@@ -284,7 +283,6 @@ const Transaction = ({ id }) => {
 
   const handleCopyClick = (waybillNumber) => {
     const textToCopy = waybillNumber;
-    console.log('textToCopy', textToCopy);
     navigator.clipboard.writeText(textToCopy);
     setCopied(true);
     toast.success('No Resi Berhasil di Copy');
@@ -755,7 +753,7 @@ const Transaction = ({ id }) => {
                   )}
               </div> */}
 
-              <div className='grid grid-cols-2 gap-x-6 mt-6'>
+              <div className='grid grid-cols-2 gap-x-6 mt-4'>
                 <div className='grid grid-cols-[35%_65%] gap-y-4'>
                   <div>Nama Sales</div>
                   <div>: {transaction?.data?.sales}</div>
@@ -853,11 +851,19 @@ const Transaction = ({ id }) => {
 
                     <div>No. Telepon</div>
                     <div>: </div>
-                    <div>{transaction?.data?.address?.customer?.phone}</div>
+                    <div>
+                      {transaction?.data?.address?.customer?.phone
+                        ? transaction?.data?.address?.customer?.phone
+                        : '-'}
+                    </div>
 
                     <div>Email</div>
                     <div>: </div>
-                    <div>{transaction?.data?.address?.customer?.email}</div>
+                    <div>
+                      {transaction?.data?.address?.customer?.email
+                        ? transaction?.data?.address?.customer?.email
+                        : '-'}
+                    </div>
 
                     <div>Alamat Pengiriman</div>
                     <div>: </div>
@@ -906,27 +912,33 @@ const Transaction = ({ id }) => {
 
                     <div>Kurir</div>
                     <div>: </div>
-                    <div className='flex flex-row gap-1 items-center justify-start'>
-                      {transaction?.data?.pickings[0]?.carrierName ? (
-                        <>
-                          <p>{transaction?.data?.pickings[0]?.carrierName}</p>
-                          <span
-                            className='text-red-500 text-xs font-semibold hover:cursor-pointer'
-                            onClick={() =>
-                              setIdAWB(transaction?.data?.pickings[0]?.id)
-                            }
-                          >
-                            Lacak Pengiriman
-                          </span>
-                        </>
-                      ) : (
-                        '-'
-                      )}
-                    </div>
+                    {transaction?.data?.pickings[0]?.carrierName ? (
+                      <div className='flex flex-row  w-full gap-1 items-start justify-start '>
+                        <p className=' text-nowrap'>
+                          {transaction?.data?.pickings[0]?.carrierName}
+                        </p>
+                        <span
+                          className='text-red-500 text-sm  font-semibold hover:cursor-pointer'
+                          onClick={() =>
+                            setIdAWB(transaction?.data?.pickings[0]?.id)
+                          }
+                        >
+                          Lacak Pengiriman
+                        </span>
+                      </div>
+                    ) : (
+                      '-'
+                    )}
 
                     <div>Jenis Service</div>
                     <div>: </div>
-                    <div>BELUM TAU AMBIL DARI MANA</div>
+                    <div>
+                      {' '}
+                      {transaction?.data?.pickings[0]?.serviceType &&
+                      transaction?.data?.pickings[0]?.carrierName
+                        ? transaction?.data?.pickings[0]?.serviceType
+                        : '-'}
+                    </div>
 
                     <div>Tanggal Kirim</div>
                     <div>: </div>
-- 
cgit v1.2.3

