import { Fragment } from 'inferno';
import { useBackend } from '../backend';
import { Box, Button, Flex, LabeledList, Section } from '../components';
import { Window } from '../layouts';
import { BeakerContents } from './common/BeakerContents';
import { ComplexModal, modalOpen } from './common/ComplexModal';
export const ChemSynthesizer = (props, context) => {
return (
);
};
const ChemSynthesizerQueueRecipes = (props, context) => {
const { act, data } = useBackend(context);
const { busy, use_catalyst, queue = [], recipes = [], production_mode } = data;
return (
act('add_recipe')}
/>
}>
{(recipes.length &&
recipes.map((item) => {
return (
act('add_queue', {
qa_index: item.name,
})
}
/>
act('exp_recipe', {
exp_index: item.name,
})
}
/>
act('rem_recipe', {
rm_index: item.name,
})
}
/>
);
})) || No recipes found.}
);
};
const ChemSynthesizerChemicals = (props, context) => {
const { act, data } = useBackend(context);
const {
busy,
chemicals = [],
rxn_vessel = [],
catalyst,
catalystCurrentVolume,
catalystMaxVolume,
catalyst_reagents = [],
} = data;
const flexFillers = [];
for (let i = 0; i < (chemicals.length + 1) % 3; i++) {
flexFillers.push(true);
}
return (
{chemicals.map((c, i) => (
))}
{flexFillers.map((_, i) => (
))}
{rxn_vessel.length > 0 ? (
) : (
Vessel is empty.
)}
{!!catalyst && (
{catalystCurrentVolume} / {catalystMaxVolume} units
)}
act('eject_catalyst')} />
}>
);
};
const ChemSynthesizerSettings = (props, context) => {
const { act, data } = useBackend(context);
const { busy, production_mode, panel_open, rxn_vessel, drug_substance, bottle_icon, pill_icon, patch_icon } = data;
return (
act('mode_toggle')}
/>
act('panel_toggle')}
/>
{!busy && (
act('bottle_product')}
/>
)}
act('emergency_stop')}
/>
act('drug_form', { drug_index: 1 })}
/>
modalOpen(context, 'change_bottle_style')}>
Style
act('drug_form', { drug_index: 2 })}
/>
modalOpen(context, 'change_pill_style')}>
Style
act('drug_form', { drug_index: 3 })}
/>
modalOpen(context, 'change_patch_style')}>
Style
);
};