import { useBackend } from '../backend';
import { Button, LabeledList, Section, ColorBox, NoticeBox, Box } from '../components';
import { Window } from '../layouts';
export const PrecisionEditor = (props, context) => {
const { act, data } = useBackend(context);
// Extract `health` and `color` variables from the `data` object.
const { screenstate } = data;
return (
{screenstate === 'main' && }
{screenstate === 'colors' && }
{screenstate === 'reagents' && }
);
};
const SeedStatus = (props, context) => {
const { act, data } = useBackend(context);
const { health, plantcolor, fruitcolor, chems, seedname } = data;
return (
{chems ? (
<>
{seedname}
{health < 100 ? (
{100 - health + '%'}
) : (
{'UNVIABLE'}
)}
{plantcolor}
{fruitcolor}
{chems.map((item) => (
);
};
const ColorEditor = (props, context) => {
const { act, data } = useBackend(context);
const { plantcolor, fruitcolor } = data;
return (
{plantcolor}
{fruitcolor}
act('change_color', { option: 0 })} />
act('change_color', { option: 1 })} />
act('change_focus', { window: 'main' })} />
);
};
const BiochemEditor = (props, context) => {
const { act, data } = useBackend(context);
const { beakerchems, health } = data;
return (
{health < 100 ? (
{100 - health + '%'}
) : (
{'UNVIABLE'}
)}
{'Available chems to choose are based on the reagents stored in the beaker. '}
{' A minimum of 100 units of reagent is required to generate a viable sequence. '}
{'The chosen reagent will be consumed in the process.'}
{'This process severely damages genetic integrity.'}
{'Plant will produce 1 additional unit for every 25 units beyond 100'}
{' (modified by potency)'}
{beakerchems ? (
<>
{health < 100 ? (
{beakerchems.map((item) => (
act('add_chem', { target_chem: item.name })}
/>
))}
) : (
{'WARNING: Genetic integrity of seed is too poor to proceed.'}
)}
act('eject_beaker')} />
>
) : (
{'There is currently no beaker loaded.'}
)}
act('change_focus', { window: 'main' })} />
);
};