refactor: replaced topology axios call with bee-js

This commit is contained in:
Vojtech Simetka
2021-04-02 10:44:44 +02:00
parent d711b4cd85
commit 53dd4e1741
8 changed files with 70 additions and 79 deletions
+16 -12
View File
@@ -17,31 +17,35 @@ const useStyles = makeStyles({
});
interface IProps {
label: string,
statistic: string,
loading?: boolean,
label: string
statistic?: string
loading?: boolean
}
export default function StatCard(props: IProps) {
export default function StatCard({loading, label, statistic}: IProps) {
const classes = useStyles();
return (
<Card className={classes.root}>
<CardContent>
{props.loading ?
<div>
{loading && (
<>
<Skeleton width={180} height={25} animation="wave" />
<Skeleton width={180} height={35} animation="wave" />
</div>
:
<div>
</>
)
}
{!loading && (
<>
<Typography className={classes.title} color="textSecondary" gutterBottom>
{props.label}
{label}
</Typography>
<Typography variant="h5" component="h2">
{props.statistic}
{statistic}
</Typography>
</div>
</>
)
}
</CardContent>
</Card>