diff --git a/frontend/src/components/Common/ReportForThreeColumns/index.tsx b/frontend/src/components/Common/ReportForThreeColumns/index.tsx index 86bb94cefd..412ee59f5d 100644 --- a/frontend/src/components/Common/ReportForThreeColumns/index.tsx +++ b/frontend/src/components/Common/ReportForThreeColumns/index.tsx @@ -79,31 +79,40 @@ export const ReportForThreeColumns = ({ : ''; }; - const shouldShowLoading = !errorMessage && !data; - const shouldShowData = !errorMessage && data; + const renderLoading = () => ( + <> + {!errorMessage && !data && ( + + + + )} + + ); + + const renderData = () => ( + <> + {!errorMessage && data && ( + + + + {fieldName} + {listName} + {`Value${getTitleUnit(title)}`} + + + {renderRows()} +
+ )} + + ); return ( <> {title} {errorMessage && } - {shouldShowLoading && ( - - - - )} - {shouldShowData && ( - - - - {fieldName} - {listName} - {`Value${getTitleUnit(title)}`} - - - {renderRows()} -
- )} + {renderLoading()} + {renderData()}
);