import { useBackend } from '../backend'; import { Box, Section, LabeledList, Button, ProgressBar, Flex, AnimatedNumber } from '../components'; import { Fragment } from 'inferno'; export const Sleeper = props => { const { act, data } = useBackend(props); const { occupied, open, occupant = [], } = data; const preSortChems = data.chems || []; const chems = preSortChems.sort((a, b) => { const descA = a.name.toLowerCase(); const descB = b.name.toLowerCase(); if (descA < descB) { return -1; } if (descA > descB) { return 1; } return 0; }); const preSortSynth = data.synthchems || []; const synthchems = preSortSynth.sort((a, b) => { const descA = a.name.toLowerCase(); const descB = b.name.toLowerCase(); if (descA < descB) { return -1; } if (descA > descB) { return 1; } return 0; }); const damageTypes = [ { label: 'Brute', type: 'bruteLoss', }, { label: 'Burn', type: 'fireLoss', }, { label: 'Toxin', type: 'toxLoss', }, { label: 'Oxygen', type: 'oxyLoss', }, ]; return (
{occupant.stat} )}> {!!occupied && ( {damageTypes.map(type => ( ))} {data.blood_status} {occupant.cloneLoss ? 'Damaged' : 'Healthy'} {occupant.brainLoss ? 'Abnormal' : 'Healthy'} )}
{data.chemical_list.map(specificChem => ( {specificChem.volume} units of {specificChem.name} ), )}
act('door')} /> )}> {chems.map(chem => (
{synthchems.map(chem => (
{chems.map(chem => (
); };