@@ -104,8 +104,10 @@ const Documents: React.FC = () => {
104104
105105 if ( documents ) {
106106 if ( documents . entry ) {
107- return (
108- < div className = { styles . total } >
107+ if ( documents . total ) {
108+
109+ return (
110+ < div className = { styles . total } >
109111 < div className = { styles . goBack } >
110112 < PatientOverview patientId = { patientId as string } /> </ div >
111113 < div className = { styles . metaDataBox } >
@@ -125,20 +127,26 @@ const Documents: React.FC = () => {
125127 </ p >
126128 </ div >
127129 </ div >
128- { loading &&
130+ { ( loading || ! document ) && currentDocumentID && ! documentLoadError &&
129131 < span className = { loadingstyles . loader } >
130132 < Spinner />
131133 </ span > }
132134 { loading == false && currentDocumentID && ! documentLoadError && document &&
133135 < div className = { styles . documentViewer } >
134136 < iframe src = { `data:application/pdf;base64,${ document } ` } />
135137 </ div > }
136- { ! currentDocumentID && ! loading && ! documentLoadError &&
138+ { ! currentDocumentID && ! loading && ! documentLoadError && documents . total > 0 &&
137139 < div className = { styles . documentInfo } >
138140 < p >
139141 Please select a document
140142 </ p >
141143 </ div > }
144+ { ! currentDocumentID && ! loading && ! documentLoadError && documents . total == 0 &&
145+ < div className = { styles . documentInfo } >
146+ < p >
147+ There is no documents here
148+ </ p >
149+ </ div > }
142150 { loading == false && currentDocumentID && documentLoadError &&
143151 < div className = { styles . documentError } >
144152 < p >
@@ -155,16 +163,51 @@ const Documents: React.FC = () => {
155163
156164 </ div >
157165 }
166+
158167 </ div >
159168 )
169+ }
170+ else {
171+ return (
172+ < div className = { styles . total } >
173+ < div className = { styles . goBack } >
174+ < PatientOverview patientId = { patientId as string } />
175+ </ div >
176+ < div className = { styles . documentInfo } >
177+ < p >
178+ There is no documents here
179+ </ p >
180+ </ div >
181+ </ div > )
182+ }
160183 }
161184 else {
162- return < > </ >
185+ return (
186+ < div className = { styles . total } >
187+ < div className = { styles . goBack } >
188+ < PatientOverview patientId = { patientId as string } />
189+ </ div >
190+ < div className = { styles . documentInfo } >
191+ < p >
192+ Could not get any documents assosiated with the patient
193+ </ p >
194+ </ div >
195+ </ div > )
163196 }
164-
197+
165198 }
166199 else if ( ! loading ) {
167- return < h1 > Could not find documents related to { patientId } </ h1 >
200+ return (
201+ < div className = { styles . total } >
202+ < div className = { styles . goBack } >
203+ < PatientOverview patientId = { patientId as string } />
204+ </ div >
205+ < div className = { styles . documentInfo } >
206+ < p >
207+ Could not find documents related to { patientId }
208+ </ p >
209+ </ div >
210+ </ div > )
168211 }
169212 else if ( loading ) {
170213 return (
0 commit comments