feat: add all source files - services, store, hooks, components, screens

This commit is contained in:
Developer
2026-03-05 18:02:54 +08:00
parent bbe0df6ed2
commit a0e53bd073
15 changed files with 755 additions and 0 deletions

16
utils/format.ts Normal file
View File

@@ -0,0 +1,16 @@
export function formatCount(n: number): string {
if (n >= 100_000_000) return (n / 100_000_000).toFixed(1) + '亿';
if (n >= 10_000) return (n / 10_000).toFixed(1) + '万';
return String(n);
}
export function formatDuration(seconds: number): string {
const m = Math.floor(seconds / 60);
const s = seconds % 60;
return `${m}:${String(s).padStart(2, '0')}`;
}
export function formatTime(ctime: number): string {
const d = new Date(ctime * 1000);
return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`;
}