import PropTypes from 'prop-types'
import React from 'react'
import { UncontrolledPopover, PopoverHeader, PopoverBody, Button } from 'reactstrap'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faTrash, faInfoCircle } from '@fortawesome/free-solid-svg-icons'
import { ProcessingUnit, StorageUnit } from '../../../../../shapes'
function UnitComponent({ index, unitType, unit, onDelete }) {
let unitInfo
if (unitType === 'cpu' || unitType === 'gpu') {
unitInfo = (
<>
Clockrate:
{unit.clockRateMhz}
Num. Cores:
{unit.numberOfCores}
Energy Cons.:
{unit.energyConsumptionW} W
>
)
} else if (unitType === 'memory' || unitType === 'storage') {
unitInfo = (
<>
Speed:
{unit.speedMbPerS} Mb/s
Size:
{unit.sizeMb} MB
Energy Cons.:
{unit.energyConsumptionW} W
>
)
}
return (