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}
{/*
*/} {/* Barang*/} {/* : {manifests?.products}*/} {/*
*/}
Kurir {' '} : {manifests?.deliveryOrder?.carrier}
Jenis Service {' '} : {manifests?.deliveryOrder?.service}
Tanggal Dikirim : {manifests?.deliveredDate}
Estimasi Tiba :{' '} {manifests?.eta}
Total Product : {Array.isArray(manifests?.products) ? manifests.products.length : 0} Product
); }; export default InformationSection;