import { round } from 'common/math';
import { useBackend } from '../backend';
import { Box, Button, LabeledList, ProgressBar, Section, AnimatedNumber } from '../components';
import { Window } from '../layouts';
import { formatPower } from '../format';
export const ICAssembly = (props, context) => {
const { act, data } = useBackend(context);
const {
total_parts,
max_components,
total_complexity,
max_complexity,
battery_charge,
battery_max,
net_power,
unremovable_circuits,
removable_circuits,
} = data;
const act_remove_cell = () => act('remove_cell');
const act_rename_assembly = () => act('rename');
return (
Remove Battery
,
,
]}>
{total_parts} / {max_components} (
{round((total_parts / max_components) * 100, 1)}%)
{total_complexity} / {max_complexity} (
{round((total_complexity / max_complexity) * 100, 1)}%)
{(battery_charge && (
{battery_charge} / {battery_max} (
{round((battery_charge / battery_max) * 100, 1)}%)
)) || No cell detected.}
{(net_power === 0 && '0 W/s') || (
'-' + formatPower(Math.abs(val)) + '/s'}
/>
)}
{(unremovable_circuits.length && (
)) ||
null}
{(removable_circuits.length && (
)) ||
null}
);
};
const ICAssemblyCircuits = (props, context) => {
const { act } = useBackend(context);
const { title, circuits } = props;
return (
{circuits.map((circuit) => (
))}
);
};