feat : add progressSpace Components and add in ListConfig
This commit is contained in:
33
src/components/progressSpace/index.tsx
Normal file
33
src/components/progressSpace/index.tsx
Normal 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;
|
||||
Reference in New Issue
Block a user