import { Fragment } from 'inferno'; import { useBackend } from '../backend'; import { Box, Button, LabeledList, NumberInput, Section } from '../components'; import { InterfaceLockNoticeBox } from './common/InterfaceLockNoticeBox'; const DISEASE_THEASHOLD_LIST = [ 'Positive', 'Harmless', 'Minor', 'Medium', 'Harmful', 'Dangerous', 'BIOHAZARD', ]; const TARGET_SPECIES_LIST = [ { name: 'Human', value: 'human', }, { name: 'Lizardperson', value: 'lizard', }, { name: 'Flyperson', value: 'fly', }, { name: 'Felinid', value: 'felinid', }, { name: 'Plasmaman', value: 'plasma', }, { name: 'Mothperson', value: 'moth', }, { name: 'Jellyperson', value: 'jelly', }, { name: 'Podperson', value: 'pod', }, { name: 'Golem', value: 'golem', }, { name: 'Zombie', value: 'zombie', }, ]; const TARGET_NUTRITION_LIST = [ { name: 'Starving', value: 150, }, { name: 'Obese', value: 600, }, ]; export const ScannerGate = props => { const { state } = props; const { act, data } = useBackend(props); return ( act('toggle_lock')} /> {!data.locked && ( )} ); }; const SCANNER_GATE_ROUTES = { Off: { title: 'Scanner Mode: Off', component: () => ScannerGateOff, }, Wanted: { title: 'Scanner Mode: Wanted', component: () => ScannerGateWanted, }, Guns: { title: 'Scanner Mode: Guns', component: () => ScannerGateGuns, }, Mindshield: { title: 'Scanner Mode: Mindshield', component: () => ScannerGateMindshield, }, Disease: { title: 'Scanner Mode: Disease', component: () => ScannerGateDisease, }, Species: { title: 'Scanner Mode: Species', component: () => ScannerGateSpecies, }, Nutrition: { title: 'Scanner Mode: Nutrition', component: () => ScannerGateNutrition, }, Nanites: { title: 'Scanner Mode: Nanites', component: () => ScannerGateNanites, }, }; const ScannerGateControl = props => { const { state } = props; const { act, data } = useBackend(props); const { scan_mode } = data; const route = SCANNER_GATE_ROUTES[scan_mode] || SCANNER_GATE_ROUTES.off; const Component = route.component(); return (
act('set_mode', { new_mode: 'Off' })} /> )}>
); }; const ScannerGateOff = props => { const { act } = useBackend(props); return ( Select a scanning mode below.