|
|
@ -1,7 +1,8 @@
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import React from 'react';
|
|
|
|
import React from 'react';
|
|
|
|
import formatBytes from 'Utilities/Number/formatBytes';
|
|
|
|
import formatBytes from 'Utilities/Number/formatBytes';
|
|
|
|
import { icons } from 'Helpers/Props';
|
|
|
|
import { icons, kinds } from 'Helpers/Props';
|
|
|
|
|
|
|
|
import Label from 'Components/Label';
|
|
|
|
import IconButton from 'Components/Link/IconButton';
|
|
|
|
import IconButton from 'Components/Link/IconButton';
|
|
|
|
import Link from 'Components/Link/Link';
|
|
|
|
import Link from 'Components/Link/Link';
|
|
|
|
import TableRow from 'Components/Table/TableRow';
|
|
|
|
import TableRow from 'Components/Table/TableRow';
|
|
|
@ -18,20 +19,35 @@ function RootFolderRow(props) {
|
|
|
|
} = props;
|
|
|
|
} = props;
|
|
|
|
|
|
|
|
|
|
|
|
const unmappedFoldersCount = unmappedFolders.length || '-';
|
|
|
|
const unmappedFoldersCount = unmappedFolders.length || '-';
|
|
|
|
|
|
|
|
const isUnavailable = freeSpace == null;
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<TableRow>
|
|
|
|
<TableRow>
|
|
|
|
<TableRowCell>
|
|
|
|
<TableRowCell>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
isUnavailable ?
|
|
|
|
|
|
|
|
<div className={styles.unavailablePath}>
|
|
|
|
|
|
|
|
{path}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Label
|
|
|
|
|
|
|
|
className={styles.unavailableLabel}
|
|
|
|
|
|
|
|
kind={kinds.DANGER}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
Unavailable
|
|
|
|
|
|
|
|
</Label>
|
|
|
|
|
|
|
|
</div> :
|
|
|
|
|
|
|
|
|
|
|
|
<Link
|
|
|
|
<Link
|
|
|
|
className={styles.link}
|
|
|
|
className={styles.link}
|
|
|
|
to={`/add/import/${id}`}
|
|
|
|
to={`/add/import/${id}`}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{path}
|
|
|
|
{path}
|
|
|
|
</Link>
|
|
|
|
</Link>
|
|
|
|
|
|
|
|
}
|
|
|
|
</TableRowCell>
|
|
|
|
</TableRowCell>
|
|
|
|
|
|
|
|
|
|
|
|
<TableRowCell className={styles.freeSpace}>
|
|
|
|
<TableRowCell className={styles.freeSpace}>
|
|
|
|
{formatBytes(freeSpace) || '-'}
|
|
|
|
{freeSpace ? formatBytes(freeSpace) : '-'}
|
|
|
|
</TableRowCell>
|
|
|
|
</TableRowCell>
|
|
|
|
|
|
|
|
|
|
|
|
<TableRowCell className={styles.unmappedFolders}>
|
|
|
|
<TableRowCell className={styles.unmappedFolders}>
|
|
|
@ -52,13 +68,12 @@ function RootFolderRow(props) {
|
|
|
|
RootFolderRow.propTypes = {
|
|
|
|
RootFolderRow.propTypes = {
|
|
|
|
id: PropTypes.number.isRequired,
|
|
|
|
id: PropTypes.number.isRequired,
|
|
|
|
path: PropTypes.string.isRequired,
|
|
|
|
path: PropTypes.string.isRequired,
|
|
|
|
freeSpace: PropTypes.number.isRequired,
|
|
|
|
freeSpace: PropTypes.number,
|
|
|
|
unmappedFolders: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
|
|
unmappedFolders: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
|
|
onDeletePress: PropTypes.func.isRequired
|
|
|
|
onDeletePress: PropTypes.func.isRequired
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
RootFolderRow.defaultProps = {
|
|
|
|
RootFolderRow.defaultProps = {
|
|
|
|
freeSpace: 0,
|
|
|
|
|
|
|
|
unmappedFolders: []
|
|
|
|
unmappedFolders: []
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|