Feature: 产品常见问题 & 相关文档下载

This commit is contained in:
2025-08-27 13:17:55 +08:00
parent 2856f2c5a1
commit 91584096ba
6 changed files with 114 additions and 14 deletions

12
app/utils/file.ts Normal file
View File

@ -0,0 +1,12 @@
export function formatFileSize(sizeInKB: number): string {
if (sizeInKB < 1024) {
return `${sizeInKB.toFixed(2)} KB`;
} else {
const sizeInMB = sizeInKB / 1024;
return `${sizeInMB.toFixed(2)} MB`;
}
}
export function formatFileExtension(ext: string): string {
return ext.startsWith('.') ? ext.slice(1).toUpperCase() : ext.toUpperCase();
}