2023-02-08 13:20:08 +00:00
|
|
|
import React from "react";
|
|
|
|
|
2023-02-20 13:30:40 +00:00
|
|
|
import { ProgressBar } from "components/ui";
|
2023-02-08 13:20:08 +00:00
|
|
|
|
|
|
|
type TSingleProgressStatsProps = {
|
|
|
|
title: any;
|
|
|
|
completed: number;
|
|
|
|
total: number;
|
|
|
|
};
|
|
|
|
|
2023-02-10 12:32:18 +00:00
|
|
|
export const SingleProgressStats: React.FC<TSingleProgressStatsProps> = ({
|
|
|
|
title,
|
|
|
|
completed,
|
|
|
|
total,
|
|
|
|
}) => (
|
2023-03-07 08:13:09 +00:00
|
|
|
<div className="flex w-full items-center justify-between py-3 text-xs">
|
2023-03-04 12:17:03 +00:00
|
|
|
<div className="flex w-1/2 items-center justify-start gap-2">{title}</div>
|
|
|
|
<div className="flex w-1/2 items-center justify-end gap-1 px-2">
|
|
|
|
<div className="flex h-5 items-center justify-center gap-1 ">
|
2023-02-10 12:32:18 +00:00
|
|
|
<span className="h-4 w-4 ">
|
2023-02-20 13:30:40 +00:00
|
|
|
<ProgressBar value={completed} maxValue={total} />
|
2023-02-10 12:32:18 +00:00
|
|
|
</span>
|
|
|
|
<span className="w-8 text-right">{Math.floor((completed / total) * 100)}%</span>
|
2023-02-08 13:20:08 +00:00
|
|
|
</div>
|
2023-02-10 12:32:18 +00:00
|
|
|
<span>of</span>
|
|
|
|
<span>{total}</span>
|
2023-02-08 13:20:08 +00:00
|
|
|
</div>
|
2023-02-10 12:32:18 +00:00
|
|
|
</div>
|
2023-02-08 13:20:08 +00:00
|
|
|
);
|