From f5ca1f5652fbbce1955d0a4ace9526eec6ae5210 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Thu, 7 Aug 2025 17:16:02 +0700
Subject: <hafid> Ongoing history transaction

---
 src/lib/transaction/components/Transaction.jsx | 256 ++++++++++---------------
 1 file changed, 96 insertions(+), 160 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 c9c0b1cc..6fabca05 100644
--- a/src/lib/transaction/components/Transaction.jsx
+++ b/src/lib/transaction/components/Transaction.jsx
@@ -581,105 +581,54 @@ const Transaction = ({ id }) => {
           <Divider />
 
           <div className='p-4'>
-            {transaction.data?.pickings?.length != 0 &&(
-            <div className='flex flex-row justify-between items-center'>
-              <div className='font-medium'>Info Pengiriman</div>
-              <span
-                className='text-red-500'
-                onClick={() => setIdAWB(transaction?.data?.pickings[0]?.id)}
-              >
-                Lihat Detail
-              </span>
-            </div>
-            )}
-            <hr className='mt-4 mb-4 border border-gray-100' />
-            <div className='flex flex-col gap-y-4'>
-            <DescriptionRow label='Estimasi Pengiriman'>
-              <div className='flex font-semibold text-red-500'>
-                {transaction.data?.expectedReadyToShip}
+            <div className='font-medium mb-4'>Info Pengiriman</div>
+            {transaction?.data?.pickings.length == 0 && (
+              <div className='badge-red text-sm'>
+                Belum ada pengiriman
               </div>
-            </DescriptionRow>
-              <DescriptionRow label='Dokumen Pengiriman'>
-                <p className='text-red-500 font-semibold text-start'>
-                  {transaction.data?.pickings?.length == 0
-                    ? 'Belum ada pengiriman'
-                    : transaction?.data?.pickings[0].name}
-                </p>
-              </DescriptionRow>
-              <DescriptionRow label='Kurir'>
-                <p className='text-start'>
-                  {transaction?.data?.pickings[0]?.carrierName ? (
-                    <p className=' text-nowrap'>
-                      {transaction?.data?.pickings[0]?.carrierName}
-                    </p>
-                  ) : (
-                    '-'
-                  )}
-                </p>
-              </DescriptionRow>
-              <DescriptionRow label='Jenis Service'>
-                <p className='text-start'>
-                  {transaction?.data?.pickings[0]?.serviceType &&
-                  transaction?.data?.pickings[0]?.carrierName
-                    ? transaction?.data?.pickings[0]?.serviceType
-                    : '-'}
-                </p>
-              </DescriptionRow>
-              <DescriptionRow label='Nomor Resi'>
-                <div className='flex flex-row gap-1 text-start'>
-                  {transaction?.data?.pickings[0]?.trackingNumber || '-'}
-                  {transaction?.data?.pickings[0]?.trackingNumber && (
-                    <button
-                      className={`${
-                        copied ? 'text-gray-400' : 'text-red-600 '
-                      }`}
-                      onClick={() =>
-                        handleCopyClick(
-                          transaction?.data?.pickings[0]?.trackingNumber
-                        )
+            )}
+            {transaction?.data?.pickings?.map((airway) => (
+              <div
+                key={airway?.id}
+                className='border border-gray_r-6 rounded mb-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;
                       }
-                    >
-                      <svg
-                        aria-hidden='true'
-                        fill='none'
-                        stroke='currentColor'
-                        stroke-width='1.5'
-                        viewBox='0 0 24 24'
-                        className='w-5 h-6'
-                      >
-                        <path
-                          d='M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 01-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 011.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 00-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 01-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 00-3.375-3.375h-1.5a1.125 1.125 0 01-1.125-1.125v-1.5a3.375 3.375 0 00-3.375-3.375H9.75'
-                          stroke-linecap='round'
-                          stroke-linejoin='round'
-                        ></path>
-                      </svg>
-                    </button>
-                  )}
-                </div>
-              </DescriptionRow>
-              <DescriptionRow label='Estimasi Tiba'>
-                <p className='text-start'>
-                  {transaction?.data?.pickings[0]?.eta
-                    ? transaction?.data?.pickings[0]?.eta
-                    : '-'}
-                </p>
-              </DescriptionRow>
-              <DescriptionRow label='Alamat Pengiriman'>
-                <div className='flex flex-col justify-start items-start'>
-                  <div className='text-start text-nowrap truncate w-full'>
-                    {transaction?.data?.address?.customer?.name}
-                  </div>
-                  <div className='text-start'>
-                    {transaction?.data?.address?.customer?.phone
-                      ? transaction?.data?.address?.customer?.phone
-                      : '-'}
-                  </div>
-                  <div className='text-start'>
-                    {transaction?.data?.address?.customer?.alamatBisnis}
-                  </div>
+                      setIdAWB(airway.id);
+                    }}
+                  >
+                    Lacak Pengiriman
+                  </button>
                 </div>
-              </DescriptionRow>
-            </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>
 
@@ -1164,72 +1113,59 @@ const Transaction = ({ id }) => {
                 </div>
               </div>
 
-              <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 className='w-1/2'>
-                  <div className='text-h-sm font-semibold mt-10 mb-4'>
-                    Informasi Pengiriman
+              <div className='text-h-sm font-semibold mt-2 mb-4'>
+                Informasi Pengiriman
+              </div>
+              <div className='flex gap-3'>
+                {transaction?.data?.pickings.length == 0 && (
+                  <div className='badge-red text-sm'>
+                    Belum ada 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-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>
+                )}
+                {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>
-                    // <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>
+                  // <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 className='flex '>
-- 
cgit v1.2.3

