import { round } from 'common/math';
import { useBackend } from '../backend';
import { Box, Flex, LabeledList, ProgressBar, Section } from '../components';
import { Window } from '../layouts';
import { formatSiUnit, formatPower } from '../format';
export const TEGenerator = (props, context) => {
const { data } = useBackend(context);
const { totalOutput, maxTotalOutput, thermalOutput, primary, secondary } = data;
return (
{formatPower(totalOutput)}
{formatPower(thermalOutput)}
{primary && secondary ? (
) : (
Warning! Both circulators must be connected in order to operate this machine.
)}
);
};
const TEGCirculator = (props, context) => {
const { name, values } = props;
const { dir, output, flowCapacity, inletPressure, inletTemperature, outletPressure, outletTemperature } = values;
return (
{formatPower(output)}
{round(flowCapacity, 2)}%
{formatSiUnit(inletPressure * 1000, 0, 'Pa')}
{round(inletTemperature, 2)} K
{formatSiUnit(outletPressure * 1000, 0, 'Pa')}
{round(outletTemperature, 2)} K
);
};