diff --git a/apps/web/components/HealthScore.tsx b/apps/web/components/HealthScore.tsx index 9fb2075..2f4713c 100644 --- a/apps/web/components/HealthScore.tsx +++ b/apps/web/components/HealthScore.tsx @@ -1,3 +1,7 @@ +'use client'; + +import { useState } from 'react'; + export function HealthScore({ collateral, required, @@ -7,6 +11,8 @@ export function HealthScore({ required: bigint; reserve: bigint; }) { + const [showInfo, setShowInfo] = useState(false); + const coverageRatio = required === 0n ? 100 : Number((collateral * 100n) / required); const reserveRatio = collateral === 0n ? 0 : Number((reserve * 100n) / collateral); @@ -34,7 +40,50 @@ export function HealthScore({ return (
-

Account Health Score

+
+

Account Health Score

+ +
+ + {showInfo && ( +
+

How Health Score is Calculated

+

+ The score (0–100) is a weighted combination of your collateral ratios: +

+ +

Grade Thresholds

+ +
+ )} +

{healthScore}