(b: number)
| 2197 | const STORAGE_CAP = 5 * 1024 * 1024 // ~5 MB typical browser limit |
| 2198 | const storagePercent = Math.min(100, Math.round((storageUsed / STORAGE_CAP) * 100)) |
| 2199 | const formatBytes = (b: number) => b < 1024 ? `${b} B` : b < 1048576 ? `${(b / 1024).toFixed(1)} KB` : `${(b / 1048576).toFixed(1)} MB` |
| 2200 | |
| 2201 | const handleExport = () => { |
| 2202 | // Export everything persisted to localStorage — full self-custody backup. |