feat : add progressSpace Components and add in ListConfig

This commit is contained in:
alij
2024-06-08 23:45:05 -07:00
parent 7ef23521c0
commit 0c28e72536
4 changed files with 92 additions and 7 deletions

View File

@@ -0,0 +1,33 @@
import { motion } from "framer-motion";
import { ProgressSpaceProps } from "../../types/props";
const ProgressSpace = ({ startSpace, endSpace }: ProgressSpaceProps) => {
let startSpacePercentage;
if (typeof endSpace === "number") {
startSpacePercentage = (startSpace / endSpace) * 100;
}
return (
<div className="relative w-full h-full p-3 bg-gray-800 rounded-md flex gap-2 justify-center items-center">
<div className="flex gap-1">
<span>حجم </span>
<span>{startSpace}</span>
<span>GB</span>
</div>
<div className="w-full rounded-full h-2.5 bg-gray-700">
<motion.div
className="bg-blue-600 h-2.5 rounded-full"
animate={{ width: `${startSpacePercentage}%` }}
initial={{ width: 0 }}
transition={{ type: "tween", duration: 1 }}
style={{ transformOrigin: "right" }}
></motion.div>
</div>
<div className="flex flex-row-reverse gap-1">
<span> {endSpace}</span>
<span>GB</span>
</div>
</div>
);
};
export default ProgressSpace;