From 58601bc17b6f0516eee9c36aa36e39f1dea3ad77 Mon Sep 17 00:00:00 2001
From: trisusilo48 <tri.susilo@altama.co.id>
Date: Wed, 26 Feb 2025 10:47:58 +0700
Subject: bitehsip

---
 src/lib/treckingAwb/component/Manifest.jsx | 43 +++++++++++++++++++++++++++---
 1 file changed, 40 insertions(+), 3 deletions(-)

(limited to 'src/lib/treckingAwb/component/Manifest.jsx')

diff --git a/src/lib/treckingAwb/component/Manifest.jsx b/src/lib/treckingAwb/component/Manifest.jsx
index 87e01e38..a0df6ee9 100644
--- a/src/lib/treckingAwb/component/Manifest.jsx
+++ b/src/lib/treckingAwb/component/Manifest.jsx
@@ -7,6 +7,18 @@ import { toast } from 'react-hot-toast';
 import ImageNext from 'next/image';
 import { list } from 'postcss';
 
+
+function capitalizeFirstLetter(str) {
+  return str.charAt(0).toUpperCase() + str.slice(1);
+}
+
+
+function capitalizeWords(str) {
+  return str.split(' ').map(word => capitalizeFirstLetter(word)).join(' ');
+}
+
+
+
 const Manifest = ({ idAWB, closePopup }) => {
   const [manifests, setManifests] = useState(null);
   const [isLoading, setIsLoading] = useState(false);
@@ -101,6 +113,16 @@ const Manifest = ({ idAWB, closePopup }) => {
                 <p className='text-yellow-600 text-sm'>Sedang Dikirim</p>
               </div>
             )}
+            {manifests?.status === 'cancelled' && (
+              <div className='bg-red-800 p-2 rounded '>
+                <p className='text-white text-sm'>Di Batalkan</p>
+              </div>
+            )}
+             {manifests?.status === 'on_hold' && (
+              <div className='bg-red-800 p-2 rounded '>
+                <p className='text-white text-sm'>Ditunda Sementara </p>
+              </div>
+            )}
             {manifests?.status === 'pending' && (
               <div className='bg-red-100 p-2 rounded '>
                 <p className='text-red-600 text-sm'>Pending</p>
@@ -112,12 +134,18 @@ const Manifest = ({ idAWB, closePopup }) => {
               Estimasi tiba pada{' '}
               <span className='text-gray_r-11 text-sm'>({manifests?.eta})</span>
             </h1>
-            <h1 className='text-sm mt-2 mb-3'>
+            <h1 className='text-sm mt-2'>
               Dikirim Menggunakan{' '}
               <span className='text-red-500 font-semibold'>
                 {manifests?.deliveryOrder.carrier}
               </span>
             </h1>
+            <h2 className='text-sm mb-3'>
+              Tipe Service {' '}
+              <span className='text-red-500 font-semibold'>
+                {manifests?.deliveryOrder.service}
+              </span>
+            </h2>
             {manifests?.waybillNumber && (
               <div className='flex justify-between items-center'>
                 <h1>No. Resi</h1>
@@ -184,11 +212,20 @@ const Manifest = ({ idAWB, closePopup }) => {
                     <time class='text-sm leading-none text-gray-400'>
                       {formatCustomDate(manifest.datetime)}
                     </time>
-                    {manifests.delivered == true && index == 0 && (
+                    {manifests.delivered == true &&
+                      index == 0 &&
+                      manifests.isBiteship == false && (
+                        <p
+                          class={`leading-6 font-semibold text-sm text-green-600 `}
+                        >
+                          Sudah Sampai
+                        </p>
+                      )}
+                    {manifests.isBiteship == true && (
                       <p
                         class={`leading-6 font-semibold text-sm text-green-600 `}
                       >
-                        Sudah Sampai
+                        {capitalizeWords(manifest.status)}
                       </p>
                     )}
                     <p class={`leading-6 text-[12px] text-gray_r-11`}>
-- 
cgit v1.2.3

