import PropTypes from 'prop-types'
import React from 'react'
import Image from 'next/image'
import { Machine } from '../../../../../shapes'
import { Flex, Label } from '@patternfly/react-core'
const UnitIcon = ({ id, type }) => (
)
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