feat: display percentage of net revenue in analysis component when total revenue is greater than zero

This commit is contained in:
Yoga Pangestu 2026-08-17 22:42:32 +07:00
parent f32544ccce
commit a301e96f33

View File

@ -745,6 +745,11 @@ export default function Analysis({
</span>
<span className="text-xs leading-none font-semibold sm:text-sm">
Rp{formatRupiah(value)}
{key === 'net' && revenueSummary.total_revenue > 0 && (
<span className="ml-1 text-[10px] font-normal text-muted-foreground">
({((revenueSummary.net / revenueSummary.total_revenue) * 100).toFixed(1)}%)
</span>
)}
</span>
</button>
);