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

Function formatFileSize

frontend/src/components/ChatWindow.jsx:110–115  ·  view source on GitHub ↗
(bytes)

Source from the content-addressed store, hash-verified

108 }
109
110 const formatFileSize = (bytes) => {
111 if (!bytes) return 'Unknown size'
112 if (bytes < 1024) return `${bytes} B`
113 if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`
114 return `${(bytes / (1024 * 1024)).toFixed(1)} MB`
115 }
116
117 const getFileIcon = (file) => {
118 const ext = file.name?.split('.').pop()?.toLowerCase()

Callers 1

ChatWindowFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected