StatCard.js
25 lines
| 1 | const { Card, CardBody } = wp.components; |
| 2 | import Loading from "@/admin/settings/components/Loading"; |
| 3 | |
| 4 | export default ({ loading, title, value, label }) => { |
| 5 | if (loading) { |
| 6 | return ( |
| 7 | <Card> |
| 8 | <CardBody> |
| 9 | <Loading /> |
| 10 | </CardBody> |
| 11 | </Card> |
| 12 | ); |
| 13 | } |
| 14 | |
| 15 | return ( |
| 16 | <Card className="presto-player__stat-card"> |
| 17 | <CardBody> |
| 18 | <div className="presto-subtitle">{title}</div> |
| 19 | <h1>{value}</h1> |
| 20 | <div>{label}</div> |
| 21 | </CardBody> |
| 22 | </Card> |
| 23 | ); |
| 24 | }; |
| 25 |