diff --git a/src/incidents/view/ViewIncident.tsx b/src/incidents/view/ViewIncident.tsx index fae2e0c7ec..e68436cf26 100644 --- a/src/incidents/view/ViewIncident.tsx +++ b/src/incidents/view/ViewIncident.tsx @@ -1,4 +1,4 @@ -import { Column, Row } from '@hospitalrun/components' +import { Column, Row, Spinner } from '@hospitalrun/components' import format from 'date-fns/format' import React, { useEffect } from 'react' import { useTranslation } from 'react-i18next' @@ -31,72 +31,74 @@ const ViewIncident = () => { dispatch(fetchIncident(id)) } }, [dispatch, id]) - - return ( - <> - - -
-

{t('incidents.reports.dateOfIncident')}

-
{format(new Date(incident?.date || ''), 'yyyy-MM-dd hh:mm a')}
-
-
- -
-

{t('incidents.reports.status')}

-
{incident?.status}
-
-
- -
-

{t('incidents.reports.reportedBy')}

-
{incident?.reportedBy}
-
-
- -
-

{t('incidents.reports.reportedOn')}

-
{format(new Date(incident?.reportedOn || ''), 'yyyy-MM-dd hh:mm a')}
-
-
-
-
- - - - - - - - - - - - - - - - - - - - ) + if (incident) { + return ( + <> + + +
+

{t('incidents.reports.dateOfIncident')}

+
{format(new Date(incident.date || ''), 'yyyy-MM-dd hh:mm a')}
+
+
+ +
+

{t('incidents.reports.status')}

+
{incident.status}
+
+
+ +
+

{t('incidents.reports.reportedBy')}

+
{incident.reportedBy}
+
+
+ +
+

{t('incidents.reports.reportedOn')}

+
{format(new Date(incident.reportedOn || ''), 'yyyy-MM-dd hh:mm a')}
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + ) + } + return } export default ViewIncident