diff --git a/src/Components/Patient/SampleDetails.tsx b/src/Components/Patient/SampleDetails.tsx
index dc5995792ab..cc3d04ce30f 100644
--- a/src/Components/Patient/SampleDetails.tsx
+++ b/src/Components/Patient/SampleDetails.tsx
@@ -1,17 +1,18 @@
-import loadable from "@loadable/component";
-import { useCallback, useState } from "react";
-import { useDispatch } from "react-redux";
-import { statusType, useAbortableEffect } from "../../Common/utils";
-import { getTestSample } from "../../Redux/actions";
import { FlowModel, SampleTestModel } from "./models";
-import { FileUpload } from "./FileUpload";
-import { navigate } from "raviger";
import { GENDER_TYPES, TEST_TYPE_CHOICES } from "../../Common/constants";
-import _ from "lodash";
-import { formatDate } from "../../Utils/utils";
+import { statusType, useAbortableEffect } from "../../Common/utils";
+import { useCallback, useState } from "react";
+
+import ButtonV2 from "../Common/components/ButtonV2";
import Card from "../../CAREUI/display/Card";
+import { FileUpload } from "./FileUpload";
import Page from "../Common/components/Page";
-import ButtonV2 from "../Common/components/ButtonV2";
+import _ from "lodash";
+import { formatDate } from "../../Utils/utils";
+import { getTestSample } from "../../Redux/actions";
+import loadable from "@loadable/component";
+import { navigate } from "raviger";
+import { useDispatch } from "react-redux";
const Loading = loadable(() => import("../Common/Loading"));
diff --git a/src/Components/Patient/SamplePreview.tsx b/src/Components/Patient/SamplePreview.tsx
index dbcfe8812b8..480e2f1b7da 100644
--- a/src/Components/Patient/SamplePreview.tsx
+++ b/src/Components/Patient/SamplePreview.tsx
@@ -1,94 +1,70 @@
+import { classNames, formatDate } from "../../Utils/utils";
+import { statusType, useAbortableEffect } from "../../Common/utils";
import { useCallback, useState } from "react";
-import { Box, Button, Paper, Typography } from "@material-ui/core";
-import { makeStyles } from "@material-ui/core/styles";
+
+import ButtonV2 from "../Common/components/ButtonV2";
+import Page from "../Common/components/Page";
+import { SampleReportModel } from "./models";
import loadable from "@loadable/component";
-import { useDispatch } from "react-redux";
import { sampleReport } from "../../Redux/actions";
-import { statusType, useAbortableEffect } from "../../Common/utils";
-import { SampleReportModel } from "./models";
-import { formatDate } from "../../Utils/utils";
-const Loading = loadable(() => import("../Common/Loading"));
-const PageTitle = loadable(() => import("../Common/PageTitle"));
+import useConfig from "../../Common/hooks/useConfig";
+import { useDispatch } from "react-redux";
-const useStyles = makeStyles({
- root: {
- width: "100%",
- },
- contentDiv: {
- minHeight: "100vh",
- },
- internalUse: {
- color: "#FC1514 !important",
- },
- allLogo: {
- maxWidth: "400px",
- height: "50px",
- objectFit: "contain",
- },
- printBtn: {
- margin: "10px",
- paddingTop: "10px",
- },
- mainHeader: {
- fontWeight: 600,
- backgroundColor: "#000000 !important",
- color: "#FFFFFF !important",
- },
- subHeader: {
- fontWeight: 600,
- backgroundColor: "#444444 !important",
- color: "#FFFFFF !important",
- },
- borderTop: {
- borderTop: "1px solid gray",
- },
- borderBottom: {
- borderBottom: "1px solid gray",
- },
- borderRight: {
- borderRight: "1px solid gray",
- },
- borderLeft: {
- borderLeft: "1px solid gray",
- },
- cellTitle: {
- textAlign: "right",
- fontWeight: 600,
- paddingRight: "8px",
- paddingLeft: "4px",
- },
- cellText: {
- textAlign: "left",
- paddingLeft: "8px",
- paddingRight: "4px",
- whiteSpace: "pre-wrap",
- wordBreak: "break-word",
- },
- cellTBPadding: {
- paddingTop: "8px",
- paddingBottom: "8px",
- },
- marginRight10: {
- marginRight: "10px",
- },
- boldText: {
- fontWeight: "bold",
- },
-});
-const coronasafeLogo = "https://cdn.coronasafe.network/coronaSafeLogo.webp";
+const Loading = loadable(() => import("../Common/Loading"));
-interface samplePreviewProps {
+interface ISamplePreviewProps {
id: string;
sampleId: string;
}
-export default function SampleReport(props: samplePreviewProps) {
- const classes = useStyles();
+
+interface ISampleReportSectionProps {
+ title: string;
+ fields: {
+ title: string;
+ value: string | undefined | null;
+ }[];
+}
+
+function SampleReportSection({ title, fields }: ISampleReportSectionProps) {
+ return (
+ <>
+
+
{title}
+
+
+ {fields.map((field, i) => (
+
+ ))}
+
+ >
+ );
+}
+
+export default function SampleReport(props: ISamplePreviewProps) {
const dispatch: any = useDispatch();
const { id, sampleId } = props;
const [isLoading, setIsLoading] = useState(false);
const [sampleData, setSampleData] = useState({});
- let report: any = null;
- let reportData: any = null;
+ const { static_ohc_green_logo } = useConfig();
+
+ let report: JSX.Element = <>>;
+ let reportData: JSX.Element = <>>;
const fetchData = useCallback(
async (status: statusType) => {
@@ -115,1649 +91,388 @@ export default function SampleReport(props: samplePreviewProps) {
if (sampleData) {
reportData = (
<>
-
-