nyx-dashboard/components/StatCard.js

82 lines
1.5 KiB
JavaScript
Raw Normal View History

import {
2021-11-16 22:52:23 +01:00
Stat,
StatLabel,
StatNumber,
StatHelpText,
StatArrow,
StatGroup,
} from "@chakra-ui/react";
2021-11-16 22:52:23 +01:00
import React from "react";
import { motion } from "framer-motion";
const container = {
2021-11-16 22:52:23 +01:00
hidden: { opacity: 1, scale: 0 },
visible: {
opacity: 1,
scale: 1,
transition: {
delayChildren: 0.4,
staggerChildren: 0.3,
},
},
};
const item = {
2021-11-16 22:52:23 +01:00
hidden: { y: 20, opacity: 0 },
visible: {
y: 0,
opacity: 1,
},
};
2021-11-16 22:52:23 +01:00
const MotionStatGroup = motion(StatGroup);
const MotionStat = motion(Stat);
function StatCard() {
2021-11-16 22:52:23 +01:00
return (
<MotionStatGroup
display="flex"
flexDirection="column"
style={{ gap: "10px" }}
variants={container}
>
<MotionStat
background="gray.900"
width={300}
height={150}
p="5"
borderRadius="15px"
flexShrink={1}
variants={item}
>
<StatLabel>User Growth</StatLabel>
<StatNumber>77</StatNumber>
<StatHelpText>
<StatArrow type="increase" />
11.36%
</StatHelpText>
</MotionStat>
2021-11-16 22:52:23 +01:00
<MotionStat
background="gray.900"
width={300}
height={150}
p="5"
borderRadius="15px"
flexShrink={1}
variants={item}
>
<StatLabel>Activity</StatLabel>
<StatNumber>45 messages</StatNumber>
<StatHelpText>
<StatArrow type="decrease" />
9.05%
</StatHelpText>
</MotionStat>
</MotionStatGroup>
);
}
2021-11-16 22:52:23 +01:00
export default StatCard;