refactored ProgressCard to component

This commit is contained in:
2026-04-24 14:04:24 +05:30
parent b1509fd5ab
commit 49bdb85088
5 changed files with 82 additions and 25 deletions

View File

@@ -0,0 +1,23 @@
import ProgressCardView from "./ProgressCard.view";
import { ProgressCardProps } from "./ProgressCard.models";
import { getPercentage, parseSummary } from "./ProgressCard.utils";
export default function ProgressCard(props: ProgressCardProps) {
const { progressAmount, totalAmount, summary } = props;
const percentage = getPercentage(progressAmount, totalAmount);
const { prefixAmount, suffixString } = parseSummary(
summary,
progressAmount,
totalAmount
);
return (
<ProgressCardView
{...props}
percentage={percentage}
prefixAmount={prefixAmount}
suffixString={suffixString}
/>
);
}