feat: display postage batch usage percentage (#149)

* feat: display postage batch usage percentage

* refactor: use string template instead of concat
This commit is contained in:
Cafe137
2021-06-19 19:04:11 +02:00
committed by GitHub
parent af88027ba9
commit 6f645dc6c3
4 changed files with 40 additions and 24 deletions
+7 -7
View File
@@ -1,15 +1,15 @@
import React, { ReactElement } from 'react'
import Button from '@material-ui/core/Button'
import ListItemIcon from '@material-ui/core/ListItemIcon'
import Menu from '@material-ui/core/Menu'
import MenuItem from '@material-ui/core/MenuItem'
import ListItemIcon from '@material-ui/core/ListItemIcon'
import { PostageBatch } from '@ethersphere/bee-js'
import React, { ReactElement } from 'react'
import PeerDetailDrawer from '../../components/PeerDetail'
import { EnrichedPostageBatch } from '../../providers/Stamps'
interface Props {
stamps: PostageBatch[] | null
selectedStamp: PostageBatch | null
setSelected: (stamp: PostageBatch) => void
stamps: EnrichedPostageBatch[] | null
selectedStamp: EnrichedPostageBatch | null
setSelected: (stamp: EnrichedPostageBatch) => void
}
export default function SimpleMenu({ stamps, selectedStamp, setSelected }: Props): ReactElement | null {
@@ -38,7 +38,7 @@ export default function SimpleMenu({ stamps, selectedStamp, setSelected }: Props
}}
selected={stamp.batchID === selectedStamp?.batchID}
>
<ListItemIcon>{stamp.utilization}</ListItemIcon>
<ListItemIcon>{stamp.usageText}</ListItemIcon>
<PeerDetailDrawer peerId={stamp.batchID} />
</MenuItem>
))}