import { useBackend } from '../backend';
import { Fragment } from 'inferno';
import { Box, Section, LabeledList, Button, AnimatedNumber, NumberInput } from '../components';
import { getGasLabel } from '../constants';
export const PortableBasicInfo = props => {
const { act, data } = useBackend(props);
const {
connected,
holding,
on,
pressure,
} = data;
return (
act('power')} />
)}>
{' kPa'}
{connected ? 'Connected' : 'Not Connected'}
act('eject')} />
)}>
{holding ? (
{holding.name}
{' kPa'}
) : (
No holding tank
)}
);
};
export const PortablePump = props => {
const { act, data } = useBackend(props);
const {
direction,
holding,
target_pressure,
default_pressure,
min_pressure,
max_pressure,
} = data;
return (
act('direction')} />
)}>
act('pressure', {
pressure: value,
})} />
);
};
export const PortableScrubber = props => {
const { act, data } = useBackend(props);
const filter_types = data.filter_types || [];
return (
{filter_types.map(filter => (
act('toggle_filter', {
val: filter.gas_id,
})} />
))}
);
};