UNPKG

react-garden

Version:

React + TypeScript + ThreeJS app using Material UI on NextJS, Apollo Client, GraphQL + WordPress REST APIs, for ThreeD web development.. a part of the threed.ai code family.

83 lines (76 loc) 2.36 kB
// ** MUI Imports import Box from '@mui/material/Box' import Grid from '@mui/material/Grid' import Card from '@mui/material/Card' import IconButton from '@mui/material/IconButton' import CardHeader from '@mui/material/CardHeader' import Typography from '@mui/material/Typography' import CardContent from '@mui/material/CardContent' // ** Icons Imports import TrendingUp from 'mdi-material-ui/TrendingUp' import CurrencyUsd from 'mdi-material-ui/CurrencyUsd' import DotsVertical from 'mdi-material-ui/DotsVertical' import CellphoneLink from 'mdi-material-ui/CellphoneLink' import AccountOutline from 'mdi-material-ui/AccountOutline' // ** Custom Components Imports import CustomAvatar from '~/@core/components/mui/avatar' const salesData = [ { stats: '245k', title: 'Sales', color: 'primary', icon: <TrendingUp /> }, { stats: '12.5k', title: 'Customers', color: 'success', icon: <AccountOutline /> }, { stats: '1.54k', color: 'warning', title: 'Products', icon: <CellphoneLink /> }, { stats: '$88k', color: 'info', title: 'Revenue', icon: <CurrencyUsd /> } ] const renderStats = () => { return salesData.map((sale, index) => ( <Grid item xs={6} md={3} key={index}> <Box key={index} sx={{ display: 'flex', alignItems: 'center' }}> <CustomAvatar variant='rounded' color={sale.color} sx={{ mr: 3, boxShadow: 3 }}> {sale.icon} </CustomAvatar> <Box sx={{ display: 'flex', flexDirection: 'column' }}> <Typography variant='caption'>{sale.title}</Typography> <Typography variant='h6'>{sale.stats}</Typography> </Box> </Box> </Grid> )) } const CardStatisticsTransactions = () => { return ( <Card> <CardHeader title='Transactions' titleTypographyProps={{ sx: { lineHeight: '2rem !important', letterSpacing: '0.15px !important' } }} action={ <IconButton size='small' aria-label='settings' className='card-more-options' sx={{ color: 'text.secondary' }}> <DotsVertical /> </IconButton> } /> <CardContent> <Grid container>{renderStats()}</Grid> </CardContent> </Card> ) } export default CardStatisticsTransactions