From 900372920d521ee940b141646381d363d487e4d0 Mon Sep 17 00:00:00 2001
From: trisusilo48 <tri.susilo@altama.co.id>
Date: Mon, 14 Apr 2025 16:47:04 +0700
Subject: transaction

---
 src/lib/transaction/components/Transaction.jsx | 89 +++++++++++++++-----------
 1 file changed, 51 insertions(+), 38 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 2ca7d386..62743df3 100644
--- a/src/lib/transaction/components/Transaction.jsx
+++ b/src/lib/transaction/components/Transaction.jsx
@@ -41,6 +41,7 @@ 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';
 const Transaction = ({ id }) => {
   const PPN = process.env.NEXT_PUBLIC_PPN;
   const router = useRouter();
@@ -208,7 +209,9 @@ const Transaction = ({ id }) => {
           <p>{currencyFormat(transaction.data?.amountUntaxed)}</p>
         </div>
         <div className='flex justify-between mt-1'>
-          <p className='text-gray_r-12/70'>PPN {((PPN - 1) * 100).toFixed(0)}%</p>
+          <p className='text-gray_r-12/70'>
+            PPN {((PPN - 1) * 100).toFixed(0)}%
+          </p>
           <p>{currencyFormat(transaction.data?.amountTax)}</p>
         </div>
         <div className='flex justify-between mt-1'>
@@ -279,6 +282,8 @@ const Transaction = ({ id }) => {
     }
   };
 
+  console.log('ini transaction', transaction.data);
+
   return (
     transaction.data?.name && (
       <>
@@ -731,52 +736,58 @@ 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>
-                          <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 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>
+                    // <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 '>
                 <div className='invoice w-1/2 '>
                   <div className='text-h-sm font-semibold mt-10 mb-4 '>
                     Invoice
@@ -976,7 +987,9 @@ const Transaction = ({ id }) => {
                       {currencyFormat(transaction.data?.amountUntaxed)}
                     </div>
 
-                    <div className='text-right'>PPN {((PPN - 1) * 100).toFixed(0)}%</div>
+                    <div className='text-right'>
+                      PPN {((PPN - 1) * 100).toFixed(0)}%
+                    </div>
                     <div className='text-right font-medium'>
                       {currencyFormat(transaction.data?.amountTax)}
                     </div>
-- 
cgit v1.2.3

