diff --git a/src/Components/Medicine/PrescriptionAdministrationsTable.tsx b/src/Components/Medicine/PrescriptionAdministrationsTable.tsx index d1fc610d055..c60d531baa3 100644 --- a/src/Components/Medicine/PrescriptionAdministrationsTable.tsx +++ b/src/Components/Medicine/PrescriptionAdministrationsTable.tsx @@ -126,6 +126,9 @@ export default function PrescriptionAdministrationsTable({ border onClick={() => setShowBulkAdminister(true)} className="w-full" + disabled={ + state === undefined || state.prescriptions.length === 0 + } > @@ -221,18 +224,19 @@ export default function PrescriptionAdministrationsTable({ refetch={refetch} /> ))} - {state?.prescriptions.length === 0 && ( -
- -

- {prn - ? "No PRN Prescriptions Prescribed" - : "No Prescriptions Prescribed"} -

-
- )} + + {state?.prescriptions.length === 0 && ( +
+ +

+ {prn + ? "No PRN Prescriptions Prescribed" + : "No Prescriptions Prescribed"} +

+
+ )} ); @@ -547,7 +551,7 @@ function getAdministrationBounds(prescriptions: Prescription[]) { curr.last_administered_on && curr.last_administered_on > latest ? curr.last_administered_on : latest, - prescriptions[0].created_date ?? new Date() + prescriptions[0]?.created_date ?? new Date() ) );