KeyInfo() → {JSX.Element}
Component that displays an icon and a key element of the user food need.
Name | Type | Description |
---|---|---|
isLoading | boolean | False if all the data have been fetched |
keyData | number | The data to be displayed |
img | string | Relative path of the icon to be displayed |
unit | string | The unit of the data to be displayed |
category | string | 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}
/>