cleanup
This commit is contained in:
@@ -76,14 +76,20 @@ export default function TopTags({
|
|||||||
|
|
||||||
arr.sort((a, b) => b.amount - a.amount);
|
arr.sort((a, b) => b.amount - a.amount);
|
||||||
|
|
||||||
const top = arr.slice(0, 5);
|
const top = arr.slice(0, 4);
|
||||||
const total = top.reduce((sum, t) => sum + t.amount, 0);
|
const total = top.reduce((sum, t) => sum + t.amount, 0);
|
||||||
|
|
||||||
return { items: top, total };
|
return { items: top, total };
|
||||||
}, [reportData, mode, selectedPeriodId]);
|
}, [reportData, mode, selectedPeriodId]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box sx={{ display: "grid", gap: 2 }}>
|
<Box
|
||||||
|
sx={{
|
||||||
|
display: "grid",
|
||||||
|
gridTemplateColumns: "repeat(4, 1fr)",
|
||||||
|
gap: 2
|
||||||
|
}}
|
||||||
|
>
|
||||||
{items.map((item) => (
|
{items.map((item) => (
|
||||||
<ProgressCard
|
<ProgressCard
|
||||||
key={item.tag}
|
key={item.tag}
|
||||||
@@ -91,6 +97,7 @@ export default function TopTags({
|
|||||||
progressAmount={item.amount}
|
progressAmount={item.amount}
|
||||||
totalAmount={total}
|
totalAmount={total}
|
||||||
compact={compact}
|
compact={compact}
|
||||||
|
colorTheme={mode === "expense" ? "error" : "success"}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
Reference in New Issue
Block a user