import { decodeHtmlEntities } from 'common/string';
import { useBackend } from '../../backend';
import { Button, LabeledList, NumberInput, Section } from '../../components';
export const Vent = (props, context) => {
const { vent } = props;
const { act } = useBackend(context);
const { id_tag, long_name, power, checks, excheck, incheck, direction, external, internal, extdefault, intdefault } =
vent;
return (
act('power', {
id_tag,
val: Number(!power),
})
}
/>
}>
{!!incheck && (
act('set_internal_pressure', {
id_tag,
value,
})
}
/>
act('reset_internal_pressure', {
id_tag,
})
}
/>
)}
{!!excheck && (
act('set_external_pressure', {
id_tag,
value,
})
}
/>
act('reset_external_pressure', {
id_tag,
})
}
/>
)}
);
};
export const Scrubber = (props, context) => {
const { scrubber } = props;
const { act } = useBackend(context);
const { long_name, power, scrubbing, id_tag, widenet, filters } = scrubber;
return (
act('power', {
id_tag,
val: Number(!power),
})
}
/>
}>
act('scrubbing', {
id_tag,
val: Number(!scrubbing),
})
}
/>
{(scrubbing &&
filters.map((filter) => (
act(filter.command, {
id_tag,
val: !filter.val,
})
}
/>
))) ||
'N/A'}
);
};