import { toFixed } from 'common/math'; import { useBackend } from '../backend'; import { AnimatedNumber, Box, Button, Icon, Knob, LabeledControls, LabeledList, Section, Tooltip } from '../components'; import { formatSiUnit } from '../format'; import { Window } from '../layouts'; export const Canister = (props, context) => { const { act, data } = useBackend(context); const { connected, can_relabel, pressure, releasePressure, defaultReleasePressure, minReleasePressure, maxReleasePressure, valveOpen, holding, } = data; return (
act('relabel')} /> }> { if (value < 10000) { return toFixed(value) + ' kPa'; } return formatSiUnit(value * 1000, 1, 'Pa'); }} /> act('pressure', { pressure: value, }) } />
act('eject')} /> ) }> {!!holding && ( {holding.name} kPa )} {!holding && No Holding Tank}
); };