Files
bee-dashboard/src/pages/stamps/StampsTable.tsx
T
Vojtech Simetka f241b2fc5f feat: updated the postage stamps page design (#217)
* feat: updated the settings page design

* chore: removed unused dependencies
2021-10-07 12:22:46 +02:00

27 lines
956 B
TypeScript

import type { ReactElement } from 'react'
import { EnrichedPostageBatch } from '../../providers/Stamps'
import ExpandableList from '../../components/ExpandableList'
import ExpandableListItem from '../../components/ExpandableListItem'
import ExpandableListItemKey from '../../components/ExpandableListItemKey'
interface Props {
postageStamps: EnrichedPostageBatch[] | null
}
function StampsTable({ postageStamps }: Props): ReactElement | null {
if (postageStamps === null) return null
return (
<ExpandableList label="Postage Stamps" defaultOpen>
{postageStamps.map(({ batchID, usageText }) => (
<ExpandableList key={batchID} label={`${batchID.substr(0, 8)}[…]`} level={1} info={`${usageText} (used)`}>
<ExpandableListItemKey label="Batch ID" value={batchID} />
<ExpandableListItem label="Usage" value={usageText} />
</ExpandableList>
))}
</ExpandableList>
)
}
export default StampsTable