import React from 'react'; import { type Patient } from '@openmrs/esm-framework'; import { useElementConfig } from '../../ward-view/ward-view.resource'; export interface WardPatientAddressProps { patient: Patient; id: string; } const WardPatientAddress: React.FC = ({ patient, id }) => { const preferredAddress = patient?.person?.preferredAddress; const config = useElementConfig('patientAddress', id); return ( <> {config?.fields?.map((field, i) => preferredAddress?.[field] ?
{preferredAddress?.[field] as string}
:
, )} ); }; export default WardPatientAddress;