File tree Expand file tree Collapse file tree
packages/react/src/views/AttachmentHandler Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,13 +41,15 @@ const AttachmentMetadata = ({
4141 } else if ( attachment ?. size ) {
4242 sizeInBytes = attachment . size ;
4343 } else {
44- sizeInBytes = 0 ;
44+ return null ;
4545 }
4646
4747 const sizeInKB = ( sizeInBytes / 1024 ) . toFixed ( 2 ) ;
4848 return `${ sizeInKB } kB` ;
4949 } ;
5050
51+ const fileSize = getFormattedFileSize ( ) ;
52+
5153 return (
5254 < Box
5355 css = { [
@@ -116,17 +118,19 @@ const AttachmentMetadata = ({
116118 : attachment ?. title }
117119 </ p >
118120 </ Tooltip >
119- < Box
120- css = { css `
121- font-size : 12px ;
122- opacity : 0.7 ;
123- @media (max-width : 420px ) {
124- margin-left : 0 ;
125- }
126- ` }
127- >
128- ({ getFormattedFileSize ( ) } )
129- </ Box >
121+ { fileSize && (
122+ < Box
123+ css = { css `
124+ font-size : 12px ;
125+ opacity : 0.7 ;
126+ @media (max-width : 420px ) {
127+ margin-left : 0 ;
128+ }
129+ ` }
130+ >
131+ ({ fileSize } )
132+ </ Box >
133+ ) }
130134 </ Box >
131135
132136 < Box
You can’t perform that action at this time.
0 commit comments