import PropTypes from 'prop-types' import React from 'react' import Image from 'next/image' import { Machine } from '../../../../../shapes' import { Badge, ListGroupItem } from 'reactstrap' const UnitIcon = ({ id, type }) => (
{'Machine
) UnitIcon.propTypes = { id: PropTypes.string, type: PropTypes.string, } const MachineComponent = ({ position, machine, onClick }) => { const hasNoUnits = machine.cpus.length + machine.gpus.length + machine.memories.length + machine.storages.length === 0 return ( {position}
{machine.cpus.length > 0 ? : undefined} {machine.gpus.length > 0 ? : undefined} {machine.memories.length > 0 ? : undefined} {machine.storages.length > 0 ? : undefined} {hasNoUnits ? Machine with no units : undefined}
) } MachineComponent.propTypes = { machine: Machine, position: PropTypes.number, onClick: PropTypes.func, } export default MachineComponent