fixes
This commit is contained in:
@@ -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}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user