@ltht-react/flag-detail 2.0.3 → 2.0.4

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 (2) hide show
  1. package/package.json +8 -7
  2. package/src/index.tsx +35 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ltht-react/flag-detail",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "ltht-react clinical FlagDetail component.",
5
5
  "author": "LTHT",
6
6
  "homepage": "",
@@ -8,7 +8,8 @@
8
8
  "main": "lib/index.js",
9
9
  "typings": "lib/index.d.ts",
10
10
  "files": [
11
- "lib"
11
+ "lib",
12
+ "src"
12
13
  ],
13
14
  "directories": {
14
15
  "lib": "lib"
@@ -27,11 +28,11 @@
27
28
  "dependencies": {
28
29
  "@emotion/react": "^11.0.0",
29
30
  "@emotion/styled": "^11.0.0",
30
- "@ltht-react/styles": "^2.0.3",
31
- "@ltht-react/type-detail": "^2.0.3",
32
- "@ltht-react/types": "^2.0.3",
33
- "@ltht-react/utils": "^2.0.3",
31
+ "@ltht-react/styles": "^2.0.4",
32
+ "@ltht-react/type-detail": "^2.0.4",
33
+ "@ltht-react/types": "^2.0.4",
34
+ "@ltht-react/utils": "^2.0.4",
34
35
  "react": "^18.2.0"
35
36
  },
36
- "gitHead": "6f18742bbf2f44123b6478257e52fbbdd291a25b"
37
+ "gitHead": "b8fe243323a0f1b9ab345475db38c73fd3b35312"
37
38
  }
package/src/index.tsx ADDED
@@ -0,0 +1,35 @@
1
+ import { FC } from 'react'
2
+ import { DetailViewType, Flag } from '@ltht-react/types'
3
+ import { getStringExtension } from '@ltht-react/utils'
4
+
5
+ import {
6
+ CodeableConceptDetail,
7
+ StringDetail,
8
+ PeriodDetail,
9
+ NarrativeDetail,
10
+ ResourceReferenceDetail,
11
+ CollapsibleDetailCollectionProps,
12
+ CollapsibleDetailCollection,
13
+ } from '@ltht-react/type-detail'
14
+
15
+ const FlagDetail: FC<Props> = ({ flag, viewType = DetailViewType.Compact }) => (
16
+ <CollapsibleDetailCollection viewType={viewType}>
17
+ <CodeableConceptDetail term="Code" concept={flag?.code} />
18
+ <StringDetail term="Status" description={flag.status.toString()} />
19
+ <CodeableConceptDetail term="Category" concept={flag?.category} />
20
+ <PeriodDetail period={flag?.period} />
21
+ <NarrativeDetail narrative={flag?.text} />
22
+ <StringDetail
23
+ term="Advice"
24
+ description={getStringExtension(flag?.extension, 'https://leedsth.nhs.uk/alert/advice')}
25
+ parse={false}
26
+ />
27
+ <ResourceReferenceDetail term="Author" resourceReference={flag?.author} />
28
+ </CollapsibleDetailCollection>
29
+ )
30
+
31
+ interface Props extends CollapsibleDetailCollectionProps {
32
+ flag: Flag
33
+ }
34
+
35
+ export default FlagDetail