-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
81 changed files
with
1,571 additions
and
1,236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
packages/esm-ward-app/src/beds/unassigned-patient.component.tsx
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React, { type ReactNode } from 'react'; | ||
import { type Bed } from '../types'; | ||
import EmptyBed from './empty-bed.component'; | ||
import styles from './ward-bed.scss'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { Tag } from '@carbon/react'; | ||
|
||
export interface WardBedProps { | ||
patientCards: Array<ReactNode>; | ||
bed: Bed; | ||
} | ||
|
||
const WardBed: React.FC<WardBedProps> = ({ bed, patientCards }) => { | ||
return patientCards?.length > 0 ? <OccupiedBed bed={bed} patientCards={patientCards} /> : <EmptyBed bed={bed} />; | ||
}; | ||
|
||
const OccupiedBed: React.FC<WardBedProps> = ({ patientCards }) => { | ||
// interlace patient card with bed dividers between each of them | ||
const patientCardsWithDividers = patientCards.flatMap((patientCard, index) => { | ||
if (index == 0) { | ||
return [patientCard]; | ||
} else { | ||
return [<BedShareDivider key={'divider-' + index} />, patientCard]; | ||
} | ||
}); | ||
|
||
return <div className={styles.occupiedBed}>{patientCardsWithDividers}</div>; | ||
}; | ||
|
||
const BedShareDivider = () => { | ||
const { t } = useTranslation(); | ||
return ( | ||
<div className={styles.bedDivider}> | ||
<div className={styles.bedDividerLine}></div> | ||
<Tag>{t('bedShare', 'Bed share')}</Tag> | ||
<div className={styles.bedDividerLine}></div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default WardBed; |
Oops, something went wrong.