feat: add aditional information to the stamps overview (#349)
This commit is contained in:
@@ -9,10 +9,13 @@ interface Props {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function PostageStamp({ stamp, shorten }: Props): ReactElement {
|
export function PostageStamp({ stamp, shorten }: Props): ReactElement {
|
||||||
|
const batchId = shorten ? stamp.batchID.slice(0, 8) : stamp.batchID
|
||||||
|
const label = `${batchId}${stamp.label ? ` - ${stamp.label}` : ''}`
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box p={2} width="100%">
|
<Box p={2} width="100%">
|
||||||
<Grid container justifyContent="space-between" alignItems="center" direction="row">
|
<Grid container justifyContent="space-between" alignItems="center" direction="row">
|
||||||
<Typography variant="subtitle2">{shorten ? stamp.batchID.slice(0, 8) : stamp.batchID}</Typography>
|
<Typography variant="subtitle2">{label}</Typography>
|
||||||
<Capacity width="100px" usage={stamp.usage} />
|
<Capacity width="100px" usage={stamp.usage} />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import ExpandableList from '../../components/ExpandableList'
|
|||||||
import ExpandableListItem from '../../components/ExpandableListItem'
|
import ExpandableListItem from '../../components/ExpandableListItem'
|
||||||
import ExpandableListItemKey from '../../components/ExpandableListItemKey'
|
import ExpandableListItemKey from '../../components/ExpandableListItemKey'
|
||||||
import { EnrichedPostageBatch } from '../../providers/Stamps'
|
import { EnrichedPostageBatch } from '../../providers/Stamps'
|
||||||
|
import { secondsToTimeString } from '../../utils'
|
||||||
import { getHumanReadableFileSize } from '../../utils/file'
|
import { getHumanReadableFileSize } from '../../utils/file'
|
||||||
import { PostageStamp } from './PostageStamp'
|
import { PostageStamp } from './PostageStamp'
|
||||||
|
|
||||||
@@ -30,6 +31,14 @@ function StampsTable({ postageStamps }: Props): ReactElement | null {
|
|||||||
)}`}
|
)}`}
|
||||||
/>
|
/>
|
||||||
<ExpandableListItem label="Amount" value={parseInt(stamp.amount, 10).toLocaleString()} />
|
<ExpandableListItem label="Amount" value={parseInt(stamp.amount, 10).toLocaleString()} />
|
||||||
|
<ExpandableListItem
|
||||||
|
label="Expires in"
|
||||||
|
value={stamp.batchTTL === -1 ? 'does not expire' : `${secondsToTimeString(stamp.batchTTL)}`}
|
||||||
|
/>
|
||||||
|
<ExpandableListItem label="Label" value={stamp.label} />
|
||||||
|
<ExpandableListItem label="Usable" value={stamp.usable ? 'yes' : 'no'} />
|
||||||
|
<ExpandableListItem label="Exists" value={stamp.exists ? 'yes' : 'no'} />
|
||||||
|
<ExpandableListItem label="Purchase Block Number" value={stamp.blockNumber} />
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user