MCPcopy Create free account
hub / github.com/HKUDS/Paper2Slides / formatFileSize

Function formatFileSize

frontend/src/components/MessageInput.jsx:71–76  ·  view source on GitHub ↗
(bytes)

Source from the content-addressed store, hash-verified

69 }
70
71 const formatFileSize = (bytes) => {
72 if (!bytes) return 'Unknown size'
73 if (bytes < 1024) return `${bytes} B`
74 if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`
75 return `${(bytes / (1024 * 1024)).toFixed(1)} MB`
76 }
77
78 const getFileTypeName = (file) => {
79 const ext = file.name?.split('.').pop()?.toLowerCase()

Callers 1

MessageInputFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected