import React, { type ReactNode } from 'react'; import { type Bed } from '../types'; import EmptyBed from './empty-bed.component'; import styles from './ward-bed.scss'; import BedShareDivider from './bed-share-divider.component'; export interface WardBedProps { patientCards: Array; bed: Bed; isLoadingDivider?: boolean; } const WardBed: React.FC = (props) => { const { bed, patientCards } = props; return patientCards?.length > 0 ? : ; }; const OccupiedBed: React.FC = ({ patientCards, isLoadingDivider, bed }) => { // interlace patient card with bed dividers between each of them const patientCardsWithDividers = patientCards.flatMap((patientCard, index) => { if (index === 0) { return [patientCard]; } else { return [, patientCard]; } }); return (
{patientCardsWithDividers}
); }; export default WardBed;