import { Fragment } from 'inferno';
import { useBackend } from '../backend';
import { Box, Button, LabeledList, ProgressBar, Section } from '../components';
import { Window } from '../layouts';
export const DiseaseSplicer = (props, context) => {
const { act, data } = useBackend(context);
const { busy } = data;
return (
{busy ? (
) : (
)}
);
};
const DiseaseSplicerVirusDish = (props, context) => {
const { act, data } = useBackend(context);
const { dish_inserted, effects, info, growth, affected_species } = data;
return (
act('eject')} />}>
{info ? (
) : (
{(effects &&
effects.map((effect) => (
({effect.stage}) {effect.name} {effect.badness > 1 ? 'Dangerous!' : null}
))) || No virus sample loaded.}
{!affected_species || !affected_species.length ? 'None' : null}
{affected_species.sort().join(', ')}
CAUTION: Reverse engineering will destroy the viral sample.
{effects.map((e) => (
)}
);
};
const DiseaseSplicerStorage = (props, context) => {
const { act, data } = useBackend(context);
const { dish_inserted, buffer, species_buffer, effects, info, growth, affected_species, busy } = data;
return (
{buffer ? (
{buffer.name} ({buffer.stage})
) : species_buffer ? (
{species_buffer}
) : (
'Empty'
)}
act('disk')}
/>
{buffer ? (
1}
onClick={() => act('splice', { splice: 1 })}
/>
2}
onClick={() => act('splice', { splice: 2 })}
/>
3}
onClick={() => act('splice', { splice: 3 })}
/>
4}
onClick={() => act('splice', { splice: 4 })}
/>
) : species_buffer ? (
act('splice', { splice: 5 })}
/>
) : null}
);
};