// 将 KB 转换为其他单位
export function convertKB(kb: number) {
    const bytes = kb * 1024
    const units = ['B', 'KB', 'MB', 'GB', 'TB']
    let size = bytes
    let unitIndex = 0

    while (size >= 1024 && unitIndex < units.length - 1) {
        size /= 1024
        unitIndex++
    }

    return { size: size.toFixed(2), unit: units[unitIndex] }
}
