KeyInfo

KeyInfo() → {JSX.Element}

Component that displays an icon and a key element of the user food need.

Properties
NameTypeDescription
isLoadingboolean

False if all the data have been fetched

keyDatanumber

The data to be displayed

imgstring

Relative path of the icon to be displayed

unitstring

The unit of the data to be displayed

categorystring

THe category of the data to be displayed

Returns:

A JSX element containing the icon, the data and unit, and the category of the data.

Type: 
JSX.Element
Example
const keyData=2500
const img='/static/media/carbs-icon.svg'
const unit='kCal'
const category='Calories'
const isLoading=false
<KeyInfo
                          className="key-info"
                          keyData={keyData.calorieCount}
                          img={caloriesIcon}
                          unit={'kCal'}
                          category={'Calories'}
                          isLoading={userInfo.isLoading}
                        />