import PropTypes from 'prop-types' import React from 'react' import { Flex, Label } from '@patternfly/react-core' import { Machine } from '../../../../shapes' const UnitIcon = ({ id, type }) => ( // eslint-disable-next-line @next/next/no-img-element {'Machine ) UnitIcon.propTypes = { id: PropTypes.string, type: PropTypes.string, } function MachineComponent({ machine, onClick }) { const hasNoUnits = machine.cpus.length + machine.gpus.length + machine.memories.length + machine.storages.length === 0 return ( onClick()}> {machine.cpus.length > 0 ? : undefined} {machine.gpus.length > 0 ? : undefined} {machine.memories.length > 0 ? : undefined} {machine.storages.length > 0 ? : undefined} {hasNoUnits ? ( ) : undefined} ) } MachineComponent.propTypes = { machine: Machine.isRequired, onClick: PropTypes.func, } export default MachineComponent