import { BooleanLike } from 'common/react'; import { useBackend } from '../backend'; import { Box, Button, LabeledList, Section } from '../components'; import { Window } from '../layouts'; type Data = { id: string; turrets: { id: string; active: BooleanLike; ref: string; effective_range; reaction_wheel_delay; recharge_time; }[]; }; export const PointDefenseControl = (props, context) => { const { act, data } = useBackend(context); const { id, turrets } = data; return (
{(turrets.length && turrets.map((pd) => (
act('toggle_active', { target: pd.ref })}> {pd.active ? 'Online' : 'Offline'} }> {pd.effective_range} {pd.reaction_wheel_delay} {pd.recharge_time}
))) || ( Error: No weapon systems detected. Please check network connection. )}
); };