From 900372920d521ee940b141646381d363d487e4d0 Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Mon, 14 Apr 2025 16:47:04 +0700 Subject: transaction --- .../treckingAwb/component/InformationSection.jsx | 73 ++++++++++++++++++++++ src/lib/treckingAwb/component/Manifest.jsx | 71 +-------------------- 2 files changed, 76 insertions(+), 68 deletions(-) create mode 100644 src/lib/treckingAwb/component/InformationSection.jsx (limited to 'src/lib/treckingAwb/component') diff --git a/src/lib/treckingAwb/component/InformationSection.jsx b/src/lib/treckingAwb/component/InformationSection.jsx new file mode 100644 index 00000000..41386683 --- /dev/null +++ b/src/lib/treckingAwb/component/InformationSection.jsx @@ -0,0 +1,73 @@ +import { useState } from "react"; +import toast from "react-hot-toast"; + +const InformationSection = ({ manifests }) => { + const [copied, setCopied] = useState(false); + + const handleCopyClick = () => { + const textToCopy = manifests?.waybillNumber; + navigator.clipboard.writeText(textToCopy); + setCopied(true); + toast.success('No Resi Berhasil di Copy'); + setTimeout(() => setCopied(false), 2000); // Reset copied state after 2 seconds + }; + + return ( +
+
+
+ Nomor Resi +
+ : {manifests?.waybillNumber} + +
+
+
+ Kurir + + {' '} + : {manifests?.deliveryOrder.carrier} + +
+
+ Jenis Service + + {' '} + : {manifests?.deliveryOrder.service} + +
+
+ Tanggal Dikirim + : {manifests?.deliveredDate} +
+
+ Estimasi Tiba + + :{' '} + {manifests?.eta} + +
+
+
+ ); +}; + +export default InformationSection; diff --git a/src/lib/treckingAwb/component/Manifest.jsx b/src/lib/treckingAwb/component/Manifest.jsx index fa998bd3..e2251e3e 100644 --- a/src/lib/treckingAwb/component/Manifest.jsx +++ b/src/lib/treckingAwb/component/Manifest.jsx @@ -6,6 +6,7 @@ import { useEffect, useState } from 'react'; import { toast } from 'react-hot-toast'; import ImageNext from 'next/image'; import { list } from 'postcss'; +import InformationSection from './InformationSection'; function capitalizeFirstLetter(str) { return str.charAt(0).toUpperCase() + str.slice(1); @@ -71,16 +72,6 @@ const Manifest = ({ idAWB, closePopup }) => { } }, [idAWB]); - const [copied, setCopied] = useState(false); - - const handleCopyClick = () => { - const textToCopy = manifests?.waybillNumber; - navigator.clipboard.writeText(textToCopy); - setCopied(true); - toast.success('No Resi Berhasil di Copy'); - setTimeout(() => setCopied(false), 2000); // Reset copied state after 2 seconds - }; - return ( <> {isLoading && ( @@ -129,64 +120,8 @@ const Manifest = ({ idAWB, closePopup }) => { )} -
-
-
- Nomor Resi -
- - : {manifests?.waybillNumber}{' '} - - -
-
-
- Kurir - - {' '} - : {manifests?.deliveryOrder.carrier} - -
-
- Jenis Service - - {' '} - : {manifests?.deliveryOrder.service} - -
-
- Tanggal Dikirim - : {manifests?.deliveredDate} -
-
- Estimasi Tiba - - :{' '} - - {manifests?.eta} - - -
-
-
+ +
{manifests?.isDelay && (