Bundle Copy

This commit is contained in:
ItsSelis
2023-05-23 17:43:01 +02:00
parent 8aad48f508
commit 3da68ee1b6
420 changed files with 47669 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
import { Box, Flex } from '../../components';
const formatUnits = (a) => a + ' unit' + (a === 1 ? '' : 's');
/**
* Displays a beaker's contents
* @property {object} props
*/
export const BeakerContents = (props) => {
const { beakerLoaded, beakerContents = [], buttons } = props;
return (
<Box>
{(!beakerLoaded && <Box color="label">No beaker loaded.</Box>) ||
(beakerContents.length === 0 && <Box color="label">Beaker is empty.</Box>)}
{beakerContents.map((chemical, i) => (
<Box key={chemical.name} width="100%">
<Flex align="center" justify="space-between">
<Flex.Item color="label">
{formatUnits(chemical.volume)} of {chemical.name}
</Flex.Item>
{!!buttons && <Flex.Item>{buttons(chemical, i)}</Flex.Item>}
</Flex>
</Box>
))}
</Box>
);
};