diff --git a/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx b/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx index 2f689c82d19..0ce1b5f7370 100644 --- a/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx +++ b/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx @@ -6,9 +6,9 @@ import request from "../../../Utils/request/request"; import routes from "../../../Redux/api"; import { RoutineAnalysisRes, RoutineFields } from "../models"; import Loading from "../../Common/Loading"; -import { classNames, formatDate, formatTime } from "../../../Utils/utils"; import Pagination from "../../Common/Pagination"; import { PAGINATION_LIMIT } from "../../../Common/constants"; +import SharedSectionTable from "../Consultations/components/SharedTable"; const PageTitle = lazy(() => import("../../Common/PageTitle")); @@ -153,65 +153,13 @@ const RoutineSection = ({ consultationId }: ConsultationTabProps) => { return (
- {Object.keys(results).map((date) => ( - |
- {formatDate(date)} -{formatTime(date)} - |
- ))}
-
---|---|
- {row.title ?? t(`LOG_UPDATE_FIELD_LABEL__${row.field!}`)} - | - {row.field && - Object.values(results).map((obj, idx) => ( -- {(() => { - const value = obj[row.field]; - if (value == null) { - return "-"; - } - if (typeof value === "boolean") { - return t(value ? "yes" : "no"); - } - const choices = REVERSE_CHOICES[row.field]; - const choice = `${row.field.toUpperCase()}__${choices[value as keyof typeof choices]}`; - return t(choice); - })()} - | - ))} -
+ {Object.keys(data).map((date) => ( + |
+ {formatDate(date)} +{formatTime(date)} + |
+ ))}
+
---|---|
+ {row.title ?? t(`${translateKey}__${row.field}`)} + | + {Object.values(data).map((obj, idx) => ( ++ {row.field + ? choices[row.field] + ? (choices[row.field][obj[row.field]] ?? "-") + : (obj[row.field] ?? "-") + : "-"} + | + ))} +