This commit is contained in:
2026-04-25 12:49:58 +05:30
parent 89ad8e376e
commit 67d4c85146
3 changed files with 62 additions and 42 deletions

View File

@@ -1,23 +1,22 @@
import * as React from "react";
import ProgressCardView from "./ProgressCard.view";
import { ProgressCardProps } from "./ProgressCard.models";
import { getPercentage, parseSummary } from "./ProgressCard.utils";
import { getPercentage, formatCurrency } from "./ProgressCard.utils";
export default function ProgressCard(props: ProgressCardProps) {
const { progressAmount, totalAmount, summary, compact = false } = props;
const { progressAmount, totalAmount, compact = false } = props;
const percentage = getPercentage(progressAmount, totalAmount);
const { prefixAmount, suffixString } = parseSummary(
summary,
progressAmount,
totalAmount
);
const formattedProgress = formatCurrency(progressAmount);
const formattedTotal = formatCurrency(totalAmount);
return (
<ProgressCardView
{...props}
percentage={percentage}
prefixAmount={prefixAmount}
suffixString={suffixString}
formattedProgress={formattedProgress}
formattedTotal={formattedTotal}
compact={compact}
/>
);