From b7833ad1d13772ea1dd7a6af6716a2c4b575132a Mon Sep 17 00:00:00 2001 From: Miqdad Date: Thu, 28 Aug 2025 17:08:20 +0700 Subject: Hide Beli lagi --- src/lib/transaction/components/Transactions.jsx | 55 +++++++++++++++---------- 1 file changed, 33 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/lib/transaction/components/Transactions.jsx b/src/lib/transaction/components/Transactions.jsx index dd927dfa..bb24f717 100644 --- a/src/lib/transaction/components/Transactions.jsx +++ b/src/lib/transaction/components/Transactions.jsx @@ -69,6 +69,10 @@ const Transactions = ({ context = '' }) => { const [contextNew, setcontextNew] = useState(router.query.context || context); const [isOpenCalender, setIsOpenCalender] = useState(false); const calendarRef = useRef(null); + const isUnpaid = (s) => + ['belum_bayar'].includes( + String(s || '').toLowerCase() + ); // loading id utk tombol lanjutkan transaksi const [contLoadingId, setContLoadingId] = useState(null); @@ -617,18 +621,22 @@ const Transactions = ({ context = '' }) => {
- + {/* Beli Lagi hanya muncul jika status bukan unpaid */} + {!isUnpaid(saleOrder.status) && ( + + )} + {/* Bayar Sekarang hanya kalau eligible */} {saleOrder?.eligibleContinue && (
- + {!isUnpaid(saleOrder.status) && ( + + )} + {/* Bayar Sekarang: hanya kalau eligible */} {saleOrder?.eligibleContinue && (