♻️ refactor: dedupe utils, lift CardGrid/IconLabel primitives

This commit is contained in:
2026-06-29 05:56:49 +07:00
parent 1a91ffbe92
commit a18d9612ee
15 changed files with 106 additions and 81 deletions
+3 -3
View File
@@ -92,10 +92,10 @@ function normalizeStatus(status?: string): UserStatus {
}
}
function toIso(v?: string | Date | null): string | undefined {
export function toIso(v?: string | Date | null): string | undefined {
if (!v) return undefined;
const s = v instanceof Date ? v.toISOString() : v;
return s === "" ? undefined : s;
const date = v instanceof Date ? v : new Date(v);
return Number.isNaN(date.getTime()) ? undefined : date.toISOString();
}
export function toUserProfile(raw: RawUser, selfId: string): UserProfile {