Move popups to their own files

Big improvement, needed to do this for a while even though it's so basic
This commit is contained in:
2026-02-14 14:06:32 -07:00
parent 7209a36752
commit 77933a2298
8 changed files with 460 additions and 452 deletions

View File

@@ -25,3 +25,17 @@ export const openFolder = async (name: string) => {
await openPath(absolutePath)
}
export const formatEtaSmart = (seconds: number) => {
if (seconds < 60) return `${Math.floor(seconds)}s`
if (seconds < 3600)
return `${Math.floor(seconds / 60)}m ${Math.floor(seconds % 60)}s`
if (seconds < 86400) {
const h = Math.floor(seconds / 3600)
const m = Math.floor((seconds % 3600) / 60)
return `${h}h ${m}m`
}
const d = Math.floor(seconds / 86400)
const h = Math.floor((seconds % 86400) / 3600)
return `${d}d ${h}h`
}