diff --git a/src/Components/Facility/ConsultationDetails/Events/GenericEvent.tsx b/src/Components/Facility/ConsultationDetails/Events/GenericEvent.tsx index ec7e844b56e..3176e18f2f3 100644 --- a/src/Components/Facility/ConsultationDetails/Events/GenericEvent.tsx +++ b/src/Components/Facility/ConsultationDetails/Events/GenericEvent.tsx @@ -50,16 +50,20 @@ const formatValue = (value: unknown, key?: string): ReactNode => { return value.toLocaleString(); } - if (Object.entries(value).length === 0) { + const entries = Object.entries(value).filter( + ([_, value]) => value != null && value !== "", + ); + + if (entries.length === 0) { return `No ${key?.replaceAll(/_/g, " ")}`; } - return Object.entries(value).map(([key, value]) => ( + return entries.map(([key, value]) => (
{key.replaceAll(/_/g, " ")} - + {formatValue(value, key)}