Fix TypeScript error in revenue page
This commit is contained in:
parent
cda25b04ca
commit
0f7e778413
1 changed files with 3 additions and 3 deletions
|
|
@ -44,14 +44,14 @@ export default function AdminRevenue() {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const generateMonthlyHistory = (proCount: number) => {
|
const generateMonthlyHistory = (proCount: number): { month: string; revenue: number }[] => {
|
||||||
const months = [];
|
const months: { month: string; revenue: number }[] = [];
|
||||||
for (let i = 11; i >= 0; i--) {
|
for (let i = 11; i >= 0; i--) {
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
date.setMonth(date.getMonth() - i);
|
date.setMonth(date.getMonth() - i);
|
||||||
months.push({
|
months.push({
|
||||||
month: date.toLocaleDateString("en-US", { month: "short", year: "2-digit" }),
|
month: date.toLocaleDateString("en-US", { month: "short", year: "2-digit" }),
|
||||||
revenue: proCount > 0 ? (proCount * PRO_PRICE).toFixed(2) : "0.00",
|
revenue: proCount > 0 ? proCount * PRO_PRICE : 0,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return months;
|
return months;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue