@kenyaemr/esm-lab-manifest-app 5.2.1-pre.821

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/.turbo/turbo-build.log +39 -0
  2. package/LICENSE.md +401 -0
  3. package/README.md +5 -0
  4. package/dist/130.js +2 -0
  5. package/dist/130.js.LICENSE.txt +3 -0
  6. package/dist/130.js.map +1 -0
  7. package/dist/152.js +1 -0
  8. package/dist/152.js.map +1 -0
  9. package/dist/255.js +2 -0
  10. package/dist/255.js.LICENSE.txt +9 -0
  11. package/dist/255.js.map +1 -0
  12. package/dist/303.js +1 -0
  13. package/dist/303.js.map +1 -0
  14. package/dist/397.js +1 -0
  15. package/dist/397.js.map +1 -0
  16. package/dist/574.js +1 -0
  17. package/dist/589.js +1 -0
  18. package/dist/589.js.map +1 -0
  19. package/dist/591.js +2 -0
  20. package/dist/591.js.LICENSE.txt +32 -0
  21. package/dist/591.js.map +1 -0
  22. package/dist/712.js +1 -0
  23. package/dist/712.js.map +1 -0
  24. package/dist/729.js +1 -0
  25. package/dist/729.js.map +1 -0
  26. package/dist/784.js +2 -0
  27. package/dist/784.js.LICENSE.txt +9 -0
  28. package/dist/784.js.map +1 -0
  29. package/dist/803.js +1 -0
  30. package/dist/803.js.map +1 -0
  31. package/dist/883.js +1 -0
  32. package/dist/883.js.map +1 -0
  33. package/dist/896.js +1 -0
  34. package/dist/896.js.map +1 -0
  35. package/dist/949.js +1 -0
  36. package/dist/949.js.map +1 -0
  37. package/dist/975.js +2 -0
  38. package/dist/975.js.LICENSE.txt +50 -0
  39. package/dist/975.js.map +1 -0
  40. package/dist/kenyaemr-esm-lab-manifest-app.js +1 -0
  41. package/dist/kenyaemr-esm-lab-manifest-app.js.buildmanifest.json +526 -0
  42. package/dist/kenyaemr-esm-lab-manifest-app.js.map +1 -0
  43. package/dist/main.js +1 -0
  44. package/dist/main.js.map +1 -0
  45. package/dist/routes.json +1 -0
  46. package/jest.config.js +8 -0
  47. package/package.json +55 -0
  48. package/src/component/lab-manifest-detail.component.tsx +21 -0
  49. package/src/component/lab-manifest.component.tsx +18 -0
  50. package/src/component/left-panel-link.component.tsx +41 -0
  51. package/src/config-schema.ts +5 -0
  52. package/src/counties.json +1494 -0
  53. package/src/declarations.d.ts +6 -0
  54. package/src/forms/lab-manifest-form.scss +126 -0
  55. package/src/forms/lab-manifest-form.workspace.tsx +357 -0
  56. package/src/header/lab-manifest-detail-header.component.tsx +74 -0
  57. package/src/header/lab-manifest-header.component.tsx +36 -0
  58. package/src/header/lab-manifest-header.scss +105 -0
  59. package/src/header/lab-manifest-illustration.component.tsx +13 -0
  60. package/src/hooks/index.ts +2 -0
  61. package/src/hooks/useActiveRequests.ts +26 -0
  62. package/src/hooks/useLabManifest.tsx +17 -0
  63. package/src/hooks/useLabManifests.ts +17 -0
  64. package/src/index.ts +36 -0
  65. package/src/lab-manifest.mock.ts +5 -0
  66. package/src/lab-manifest.resources.ts +108 -0
  67. package/src/metrics/lab-manifest-header.scss +22 -0
  68. package/src/metrics/lab-manifest-metric-value.component.tsx +25 -0
  69. package/src/metrics/lab-manifest-metrics-header.component.tsx +34 -0
  70. package/src/metrics/lab-manifest-metrics.component.tsx +27 -0
  71. package/src/metrics/lab-manifest-metrics.scss +17 -0
  72. package/src/root.component.tsx +19 -0
  73. package/src/root.scss +15 -0
  74. package/src/routes.json +33 -0
  75. package/src/setup-tests.ts +1 -0
  76. package/src/tables/lab-manifest-active-requests.component.tsx +161 -0
  77. package/src/tables/lab-manifest-samples.component.tsx +164 -0
  78. package/src/tables/lab-manifest-table.component.tsx +214 -0
  79. package/src/tables/lab-manifest-table.scss +49 -0
  80. package/src/tabs/lab-manifest-tabs-component.tsx +33 -0
  81. package/src/tabs/lab-manifest-tabs.scss +28 -0
  82. package/src/types/index.ts +75 -0
  83. package/translations/en.json +33 -0
  84. package/tsconfig.json +5 -0
  85. package/webpack.config.js +1 -0
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import styles from './lab-manifest-header.scss';
3
+ import { ChemistryReference } from '@carbon/react/icons';
4
+
5
+ const LabManifestIllustration: React.FC = () => {
6
+ return (
7
+ <div className={styles.svgContainer}>
8
+ <ChemistryReference className={styles.iconOverrides} />
9
+ </div>
10
+ );
11
+ };
12
+
13
+ export default LabManifestIllustration;
@@ -0,0 +1,2 @@
1
+ export { default as useLabManifests } from './useLabManifests';
2
+ export { default as useLabManifest } from './useLabManifest';
@@ -0,0 +1,26 @@
1
+ import { restBaseUrl } from '@openmrs/esm-framework';
2
+ import useSWR from 'swr';
3
+ import { activeRequests } from '../lab-manifest.mock';
4
+ import { ActiveRequests } from '../types';
5
+
6
+ const mockeFetch = async (url: string) => {
7
+ const status = url.split('=').at(-1);
8
+ return await new Promise<Array<ActiveRequests>>((resolve, _) => {
9
+ setTimeout(() => {
10
+ resolve(activeRequests);
11
+ }, 3000);
12
+ });
13
+ };
14
+
15
+ const useActiveRequests = () => {
16
+ const url = `${restBaseUrl}/active-request`;
17
+ const { isLoading, error, data } = useSWR<Array<ActiveRequests>>(url, mockeFetch);
18
+
19
+ return {
20
+ isLoading,
21
+ requests: data ?? [],
22
+ error,
23
+ };
24
+ };
25
+
26
+ export default useActiveRequests;
@@ -0,0 +1,17 @@
1
+ import { FetchResponse, openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
2
+ import useSWR from 'swr';
3
+ import { extractLabManifest } from '../lab-manifest.resources';
4
+ import { LabManifest } from '../types';
5
+
6
+ const useLabManifest = (manifestUuid: string) => {
7
+ const url = `${restBaseUrl}/labmanifest/${manifestUuid}`;
8
+ const { isLoading, error, data } = useSWR<FetchResponse<LabManifest>>(url, openmrsFetch);
9
+
10
+ return {
11
+ isLoading,
12
+ error,
13
+ manifest: data?.data ? extractLabManifest(data!.data!) : undefined,
14
+ };
15
+ };
16
+
17
+ export default useLabManifest;
@@ -0,0 +1,17 @@
1
+ import { FetchResponse, openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
2
+ import useSWR from 'swr';
3
+ import { extractLabManifest } from '../lab-manifest.resources';
4
+ import { LabManifest } from '../types';
5
+
6
+ const useLabManifests = (status: string) => {
7
+ const url = `${restBaseUrl}/labmanifest?v=full&status=${status}`;
8
+ const { isLoading, error, data } = useSWR<FetchResponse<{ results: Array<LabManifest> }>>(url, openmrsFetch);
9
+
10
+ return {
11
+ isLoading,
12
+ manifests: (data?.data?.results ?? []).map(extractLabManifest),
13
+ error,
14
+ };
15
+ };
16
+
17
+ export default useLabManifests;
package/src/index.ts ADDED
@@ -0,0 +1,36 @@
1
+ import { getAsyncLifecycle, defineConfigSchema, getSyncLifecycle, registerBreadcrumbs } from '@openmrs/esm-framework';
2
+ import { configSchema } from './config-schema';
3
+ import { createLeftPanelLink } from './component/left-panel-link.component';
4
+
5
+ const moduleName = '@kenyaemr/esm-lab-manifest-app';
6
+
7
+ const options = {
8
+ featureName: 'esm-lab-manifest-app',
9
+ moduleName,
10
+ };
11
+
12
+ export const importTranslation = require.context('../translations', false, /.json$/, 'lazy');
13
+
14
+ export function startupApp() {
15
+ const labManifestBasepath = `${window.spaBase}/home/lab-manifest`;
16
+
17
+ defineConfigSchema(moduleName, configSchema);
18
+ registerBreadcrumbs([
19
+ {
20
+ title: 'lab-manifest',
21
+ path: labManifestBasepath,
22
+ parent: `${window.spaBase}/home`,
23
+ },
24
+ ]);
25
+ }
26
+
27
+ export const root = getAsyncLifecycle(() => import('./root.component'), options);
28
+ export const labManifestForm = getAsyncLifecycle(() => import('./forms/lab-manifest-form.workspace'), options);
29
+
30
+ export const labManifestDashboardLink = getSyncLifecycle(
31
+ createLeftPanelLink({
32
+ name: 'lab-manifest',
33
+ title: 'Lab Manifest',
34
+ }),
35
+ options,
36
+ );
@@ -0,0 +1,5 @@
1
+ import { ActiveRequests, MappedLabManifest, LabManifestSample } from './types';
2
+
3
+ export const labManifestSamples: Array<LabManifestSample> = [];
4
+
5
+ export const activeRequests: Array<ActiveRequests> = [];
@@ -0,0 +1,108 @@
1
+ import { generateOfflineUuid, openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
2
+ import { z } from 'zod';
3
+ import { LabManifest, MappedLabManifest } from './types';
4
+
5
+ export const LabManifestFilters = [
6
+ {
7
+ label: 'Draft',
8
+ value: 'Draft',
9
+ },
10
+ {
11
+ label: 'Ready To send',
12
+ value: 'Ready to send',
13
+ },
14
+ {
15
+ label: 'On Hold',
16
+ value: 'On Hold',
17
+ },
18
+ {
19
+ label: 'Sending',
20
+ value: 'Sending',
21
+ },
22
+ {
23
+ label: 'Submitted',
24
+ value: 'Submitted',
25
+ },
26
+ {
27
+ label: 'Incomplete with Errors',
28
+ value: 'Incomplete errors',
29
+ },
30
+ {
31
+ label: 'Incomplete With Results',
32
+ value: 'Incomplete results',
33
+ },
34
+ {
35
+ label: 'Complete with Errors',
36
+ value: 'Complete errors',
37
+ },
38
+ {
39
+ label: 'Complete with Results',
40
+ value: 'Complete results',
41
+ },
42
+ ];
43
+ const PHONE_NUMBER_REGEX = /^(\+?254|0)((7|1)\d{8})$/;
44
+
45
+ export const labManifestFormSchema = z.object({
46
+ startDate: z.date({ coerce: true }),
47
+ endDate: z.date({ coerce: true }),
48
+ manifestType: z.string(),
49
+ dispatchDate: z.date({ coerce: true }),
50
+ courierName: z.string().optional(),
51
+ personHandedTo: z.string().optional(),
52
+ county: z.string().optional(),
53
+ subCounty: z.string().optional(),
54
+ facilityEmail: z.string().email(),
55
+ facilityPhoneContact: z.string().regex(PHONE_NUMBER_REGEX, { message: 'Invalid phone number' }),
56
+ clinicianName: z.string(),
57
+ clinicianContact: z.string().regex(PHONE_NUMBER_REGEX, { message: 'Invalid phone number' }),
58
+ labPersonContact: z.string().regex(PHONE_NUMBER_REGEX, { message: 'Invalid phone number' }),
59
+ manifestStatus: z.string(),
60
+ });
61
+
62
+ export const manifestTypes = [
63
+ {
64
+ value: 'VL',
65
+ label: 'Viral load',
66
+ },
67
+ ];
68
+
69
+ export const saveLabManifest = async (data: z.infer<typeof labManifestFormSchema>, manifestId: string | undefined) => {
70
+ let url;
71
+ const abortController = new AbortController();
72
+
73
+ if (!manifestId) {
74
+ url = `${restBaseUrl}/labmanifest`;
75
+ } else {
76
+ url = `${restBaseUrl}/labmanifest/${manifestId}`;
77
+ }
78
+
79
+ return openmrsFetch(url, {
80
+ headers: {
81
+ 'Content-Type': 'application/json',
82
+ },
83
+ method: 'POST',
84
+ body: JSON.stringify(data),
85
+ signal: abortController.signal,
86
+ });
87
+ };
88
+
89
+ export const extractLabManifest = (manifest: LabManifest) =>
90
+ ({
91
+ uuid: manifest.uuid,
92
+ dispatchDate: manifest.dispatchDate,
93
+ endDate: manifest.dispatchDate,
94
+ startDate: manifest.startDate,
95
+ clinicianContact: manifest.clinicianPhoneContact,
96
+ clinicianName: manifest.clinicianName,
97
+ county: manifest.county,
98
+ courierName: manifest.courier,
99
+ facilityEmail: manifest.facilityEmail,
100
+ facilityPhoneContact: manifest.facilityPhoneContact,
101
+ labPersonContact: manifest.labPocPhoneNumber,
102
+ manifestId: manifest.identifier,
103
+ manifestStatus: manifest.status,
104
+ // manifestType: manifest.manifestType,
105
+ personHandedTo: manifest.courierOfficer,
106
+ subCounty: manifest.subCounty,
107
+ samples: manifest.labManifestOrders ?? [],
108
+ } as MappedLabManifest);
@@ -0,0 +1,22 @@
1
+ @use '@carbon/styles/scss/spacing';
2
+ @use '@carbon/styles/scss/type';
3
+ @import '~@openmrs/esm-styleguide/src/vars';
4
+
5
+ .metricsContainer {
6
+ display: flex;
7
+ justify-content: space-between;
8
+ background-color: $ui-02;
9
+ height: spacing.$spacing-10;
10
+ align-items: center;
11
+ padding: 0 spacing.$spacing-05;
12
+ }
13
+
14
+ .metricsTitle {
15
+ @include type.type-style('heading-03');
16
+ color: $ui-05;
17
+ }
18
+
19
+ .actionBtn {
20
+ display: flex;
21
+ column-gap: 0.5rem;
22
+ }
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import { useLabManifests } from '../hooks';
3
+ import { SkeletonText } from '@carbon/react';
4
+ import styles from './lab-manifest-metrics.scss';
5
+
6
+ interface LabManifestMetricValueProps {
7
+ status: string;
8
+ }
9
+
10
+ const LabManifestMetricValue: React.FC<LabManifestMetricValueProps> = ({ status }) => {
11
+ const { error, isLoading, manifests } = useLabManifests(status);
12
+ if (isLoading) {
13
+ return <SkeletonText className={styles.metricContainer} />;
14
+ }
15
+ if (error) {
16
+ return;
17
+ }
18
+ return (
19
+ <span>
20
+ <strong>{status}</strong>: {manifests.length}
21
+ </span>
22
+ );
23
+ };
24
+
25
+ export default LabManifestMetricValue;
@@ -0,0 +1,34 @@
1
+ import { Button } from '@carbon/react';
2
+ import { ArrowRight } from '@carbon/react/icons';
3
+ import { launchWorkspace } from '@openmrs/esm-framework';
4
+ import React from 'react';
5
+ import { useTranslation } from 'react-i18next';
6
+ import styles from './lab-manifest-header.scss';
7
+
8
+ const MetricsHeader = () => {
9
+ const { t } = useTranslation();
10
+ const metricsTitle = t('labManifestSummary', 'Lab Manifest Summary');
11
+
12
+ const handleAddLabManifest = () => {
13
+ launchWorkspace('lab-manifest-form', {
14
+ workspaceTitle: 'Lab Manifest Form',
15
+ });
16
+ };
17
+
18
+ return (
19
+ <div className={styles.metricsContainer}>
20
+ <span className={styles.metricsTitle}>{metricsTitle}</span>
21
+ <div className={styles.actionBtn}>
22
+ <Button
23
+ kind="tertiary"
24
+ renderIcon={(props) => <ArrowRight size={16} {...props} />}
25
+ iconDescription={t('addNewManifest', 'Add new Manifest')}
26
+ onClick={handleAddLabManifest}>
27
+ {t('addNewManifest', 'Add new Manifest')}
28
+ </Button>
29
+ </div>
30
+ </div>
31
+ );
32
+ };
33
+
34
+ export default MetricsHeader;
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import { useTranslation } from 'react-i18next';
3
+ import { LabManifestFilters } from '../lab-manifest.resources';
4
+ import MetricsHeader from './lab-manifest-metrics-header.component';
5
+ import styles from './lab-manifest-metrics.scss';
6
+ import LabManifestMetricValue from './lab-manifest-metric-value.component';
7
+
8
+ export interface Service {
9
+ uuid: string;
10
+ display: string;
11
+ }
12
+
13
+ function LabManifestMetrics() {
14
+ const { t } = useTranslation();
15
+ return (
16
+ <>
17
+ <MetricsHeader />
18
+ <div className={styles.cardContainer} data-testid="clinic-metrics">
19
+ {LabManifestFilters.map((f, index) => (
20
+ <LabManifestMetricValue status={f.value} />
21
+ ))}
22
+ </div>
23
+ </>
24
+ );
25
+ }
26
+
27
+ export default LabManifestMetrics;
@@ -0,0 +1,17 @@
1
+ @use '@carbon/styles/scss/spacing';
2
+ @use '@carbon/colors';
3
+ @import '~@openmrs/esm-styleguide/src/vars';
4
+
5
+ .cardContainer {
6
+ background-color: $color-gray-30;
7
+ display: flex;
8
+ justify-content: space-between;
9
+ padding: spacing.$spacing-05;
10
+ flex-flow: row wrap;
11
+ margin-top: spacing.$spacing-05;
12
+ gap: spacing.$spacing-05;
13
+ }
14
+
15
+ .metricContainer {
16
+ max-width: spacing.$spacing-13;
17
+ }
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { BrowserRouter, Route, Routes } from 'react-router-dom';
3
+ import LabManifestComponent from './component/lab-manifest.component';
4
+ import LabManifestDetail from './component/lab-manifest-detail.component';
5
+
6
+ const Root: React.FC = () => {
7
+ const baseName = window.getOpenmrsSpaBase() + 'home/lab-manifest';
8
+
9
+ return (
10
+ <BrowserRouter basename={baseName}>
11
+ <Routes>
12
+ <Route path="/" element={<LabManifestComponent />} />
13
+ <Route path="/:manifestUuid" element={<LabManifestDetail />} />
14
+ </Routes>
15
+ </BrowserRouter>
16
+ );
17
+ };
18
+
19
+ export default Root;
package/src/root.scss ADDED
@@ -0,0 +1,15 @@
1
+ @use '@carbon/styles/scss/spacing';
2
+ @use '@carbon/styles/scss/type';
3
+
4
+ .container {
5
+ padding: spacing.$spacing-07;
6
+ }
7
+
8
+ .welcome {
9
+ @include type.type-style('heading-04');
10
+ margin: spacing.$spacing-05 0;
11
+ }
12
+
13
+ .explainer {
14
+ margin-bottom: 2rem;
15
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "$schema": "https://json.openmrs.org/routes.schema.json",
3
+ "backendDependencies": {
4
+ "webservices.rest": "^2.24.0"
5
+ },
6
+ "extensions": [
7
+ {
8
+ "component": "labManifestDashboardLink",
9
+ "name": "lab-manifest-dashboard-link",
10
+ "slot": "homepage-dashboard-slot",
11
+ "meta": {
12
+ "name": "lab-manifest",
13
+ "title": "lab-manifest",
14
+ "slot": "lab-manifest-dashboard-slot"
15
+ }
16
+ },
17
+ {
18
+ "name": "lab-manifest-form",
19
+ "component": "labManifestForm"
20
+ },
21
+ {
22
+ "component": "root",
23
+ "name": "lab-manifest-dashboard-root",
24
+ "slot": "lab-manifest-dashboard-slot"
25
+ }
26
+ ],
27
+ "pages": [
28
+ {
29
+ "component": "root",
30
+ "route": "lab-manifest"
31
+ }
32
+ ]
33
+ }
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom/extend-expect';
@@ -0,0 +1,161 @@
1
+ import {
2
+ Button,
3
+ DataTable,
4
+ DataTableSkeleton,
5
+ Pagination,
6
+ Table,
7
+ TableBody,
8
+ TableCell,
9
+ TableContainer,
10
+ TableHead,
11
+ TableHeader,
12
+ TableRow,
13
+ } from '@carbon/react';
14
+ import { View } from '@carbon/react/icons';
15
+ import { ErrorState, navigate, useLayoutType, usePagination } from '@openmrs/esm-framework';
16
+ import { CardHeader, EmptyState, usePaginationInfo } from '@openmrs/esm-patient-common-lib';
17
+ import React, { useState } from 'react';
18
+ import { useTranslation } from 'react-i18next';
19
+ import styles from './lab-manifest-table.scss';
20
+ import useActiveRequests from '../hooks/useActiveRequests';
21
+ import { ActiveRequests } from '../types';
22
+
23
+ interface LabManifestActiveRequestsProps {
24
+ manifestUuid: string;
25
+ }
26
+
27
+ const LabManifestActiveRequests: React.FC<LabManifestActiveRequestsProps> = ({ manifestUuid }) => {
28
+ const { error, isLoading, requests } = useActiveRequests();
29
+
30
+ const { t } = useTranslation();
31
+ const [pageSize, setPageSize] = useState(10);
32
+ const headerTitle = t('activeRequests', 'Active Requests');
33
+ const { results, totalPages, currentPage, goTo } = usePagination(requests, pageSize);
34
+ const { pageSizes } = usePaginationInfo(pageSize, totalPages, currentPage, results.length);
35
+
36
+ const headers = [
37
+ {
38
+ header: t('patientName', 'Patient name'),
39
+ key: 'startDate',
40
+ },
41
+ {
42
+ header: t('cccKDODNumber', 'CCC/KDOD Number'),
43
+ key: 'cccKDODNumber',
44
+ },
45
+ {
46
+ header: t('batchNumber', 'Batch Number'),
47
+ key: 'batchNumber',
48
+ },
49
+ {
50
+ header: t('sampleType', 'Sample type'),
51
+ key: 'sampleType',
52
+ },
53
+ {
54
+ header: t('manifestId', 'Manifest Id'),
55
+ key: 'manifestId',
56
+ },
57
+ {
58
+ header: t('labPersonContact', 'Lab person Contact'),
59
+ key: 'labPersonContact',
60
+ },
61
+ {
62
+ header: t('status', 'Status'),
63
+ key: 'status',
64
+ },
65
+ {
66
+ header: t('dispatch', 'Dispatch'),
67
+ key: 'dispatch',
68
+ },
69
+ {
70
+ header: t('actions', 'Actions'),
71
+ key: 'actions',
72
+ },
73
+ ];
74
+
75
+ const handleViewManifestSamples = (manifestUuid: string) => {
76
+ navigate({ to: window.getOpenmrsSpaBase() + `home/lab-manifest/${manifestUuid}` });
77
+ };
78
+
79
+ const tableRows =
80
+ (results as ActiveRequests[])?.map((activeRequest) => {
81
+ return {
82
+ id: `${activeRequest.uuid}`,
83
+ actions: (
84
+ <Button
85
+ renderIcon={View}
86
+ hasIconOnly
87
+ kind="tertiary"
88
+ iconDescription={t('view', 'View')}
89
+ onClick={() => handleViewManifestSamples(activeRequest.uuid)}
90
+ />
91
+ ),
92
+ };
93
+ }) ?? [];
94
+
95
+ if (isLoading) {
96
+ return <DataTableSkeleton rowCount={5} />;
97
+ }
98
+ if (error) {
99
+ return <ErrorState headerTitle={headerTitle} error={error} />;
100
+ }
101
+
102
+ if (requests.length === 0) {
103
+ return (
104
+ <EmptyState
105
+ headerTitle={t('activeRequests', 'Active Requests')}
106
+ displayText={t('notLabManifetToDisplay', 'There is no lab manifets data to display.')}
107
+ />
108
+ );
109
+ }
110
+ return (
111
+ <div className={styles.widgetContainer}>
112
+ <CardHeader title={headerTitle}>{''}</CardHeader>
113
+ <DataTable
114
+ useZebraStyles
115
+ size="sm"
116
+ rows={tableRows ?? []}
117
+ headers={headers}
118
+ render={({ rows, headers, getHeaderProps, getTableProps, getTableContainerProps }) => (
119
+ <TableContainer {...getTableContainerProps()}>
120
+ <Table {...getTableProps()}>
121
+ <TableHead>
122
+ <TableRow>
123
+ {headers.map((header) => (
124
+ <TableHeader
125
+ {...getHeaderProps({
126
+ header,
127
+ isSortable: header.isSortable,
128
+ })}>
129
+ {header.header?.content ?? header.header}
130
+ </TableHeader>
131
+ ))}
132
+ </TableRow>
133
+ </TableHead>
134
+ <TableBody>
135
+ {rows.map((row) => (
136
+ <TableRow key={row.id}>
137
+ {row.cells.map((cell) => (
138
+ <TableCell key={cell.id}>{cell.value}</TableCell>
139
+ ))}
140
+ </TableRow>
141
+ ))}
142
+ </TableBody>
143
+ </Table>
144
+ </TableContainer>
145
+ )}
146
+ />
147
+ <Pagination
148
+ page={currentPage}
149
+ pageSize={pageSize}
150
+ pageSizes={pageSizes}
151
+ totalItems={requests.length}
152
+ onChange={({ page, pageSize }) => {
153
+ goTo(page);
154
+ setPageSize(pageSize);
155
+ }}
156
+ />
157
+ </div>
158
+ );
159
+ };
160
+
161
+ export default LabManifestActiveRequests;