()
| 11 | import { clamp } from '@/lib/utils' |
| 12 | |
| 13 | async function fetchCurrentBalance(): Promise<number> { |
| 14 | const response = await fetch('/api/user/usage') |
| 15 | if (!response.ok) throw new Error('Failed to fetch balance') |
| 16 | const data = await response.json() |
| 17 | return data.balance?.totalRemaining ?? 0 |
| 18 | } |
| 19 | |
| 20 | const { |
| 21 | MIN_THRESHOLD_CREDITS, |
no test coverage detected