@ -13,13 +13,13 @@ function RootFolderRow(props) {
const {
const {
id ,
id ,
path ,
path ,
accessible ,
freeSpace ,
freeSpace ,
unmappedFolders ,
unmappedFolders ,
onDeletePress
onDeletePress
} = props ;
} = props ;
const unmappedFoldersCount = unmappedFolders . length || '-' ;
const isUnavailable = ! accessible ;
const isUnavailable = freeSpace == null ;
return (
return (
< TableRow >
< TableRow >
@ -47,11 +47,11 @@ function RootFolderRow(props) {
< / T a b l e R o w C e l l >
< / T a b l e R o w C e l l >
< TableRowCell className = { styles . freeSpace } >
< TableRowCell className = { styles . freeSpace } >
{ freeSpace ? formatBytes ( freeSpace ) : '-' }
{ ( isUnavailable || isNaN ( freeSpace ) ) ? '-' : formatBytes ( freeSpace ) }
< / T a b l e R o w C e l l >
< / T a b l e R o w C e l l >
< TableRowCell className = { styles . unmappedFolders } >
< TableRowCell className = { styles . unmappedFolders } >
{ unmappedFoldersCount }
{ isUnavailable ? '-' : unmappedFolders . length }
< / T a b l e R o w C e l l >
< / T a b l e R o w C e l l >
< TableRowCell className = { styles . actions } >
< TableRowCell className = { styles . actions } >
@ -68,6 +68,7 @@ function RootFolderRow(props) {
RootFolderRow . propTypes = {
RootFolderRow . propTypes = {
id : PropTypes . number . isRequired ,
id : PropTypes . number . isRequired ,
path : PropTypes . string . isRequired ,
path : PropTypes . string . isRequired ,
accessible : PropTypes . bool . isRequired ,
freeSpace : PropTypes . number ,
freeSpace : PropTypes . number ,
unmappedFolders : PropTypes . arrayOf ( PropTypes . object ) . isRequired ,
unmappedFolders : PropTypes . arrayOf ( PropTypes . object ) . isRequired ,
onDeletePress : PropTypes . func . isRequired
onDeletePress : PropTypes . func . isRequired