import { useBackend } from '../backend'; import { Window } from '../layouts'; import { Button, Box, Section, LabeledList, NumberInput, AnimatedNumber } from '../components'; import { round } from 'common/math'; import { formatSiUnit, formatPower } from '../format'; export const ShieldCapacitor = (props, context) => { const { act, data } = useBackend(context); const { active, time_since_fail, stored_charge, max_charge, charge_rate, max_charge_rate } = data; return (
act('toggle')} /> }> {time_since_fail > 2 ? OK. : Discharging!} formatSiUnit(val, 0, 'J')} /> ( %) formatPower(val)} onDrag={(e, val) => act('charge_rate', { rate: val })} />
); };