[st frontend] as 사용자 뷰 정보 표시 정리

This commit is contained in:
2026-05-29 13:25:16 +09:00
parent 68ac1168e9
commit 49ec6423bd
2 changed files with 172 additions and 69 deletions
+12
View File
@@ -0,0 +1,12 @@
/* Shared file utilities for apps/as */
/** 파일 크기는 byte 단위로 제공된다고 가정하고 크기에 따라서 KB, MB 단위로 표시 */
export const formatFileSize = (bytes?: number | null): string => {
if (bytes === null || bytes === undefined) return "-";
const b = Number(bytes) || 0;
if (b >= 1024 * 1024) return `${(b / 1024 / 1024).toFixed(1)}MB`;
if (b >= 1024) return `${Math.round(b / 1024)}KB`;
return `${b}B`;
};
export default { formatFileSize };