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

Function formatFileSize

frontend/src/components/MessageList.jsx:17–22  ·  view source on GitHub ↗
(bytes)

Source from the content-addressed store, hash-verified

15 }
16
17 const formatFileSize = (bytes) => {
18 if (!bytes) return 'Unknown size'
19 if (bytes < 1024) return `${bytes} B`
20 if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`
21 return `${(bytes / (1024 * 1024)).toFixed(1)} MB`
22 }
23
24 const getFileIcon = (file) => {
25 const ext = file.name?.split('.').pop()?.toLowerCase()

Callers 1

MessageListFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected