mirror of https://github.com/micromata/borgbackup-butler.git

Kai Reinhard
16.39.2019 60cbf9cab14aa492899699e505501d144d30ca14
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import React from 'react';
import PropTypes from 'prop-types';
import {Table} from 'reactstrap';
import FileListEntry from './FileListEntry';
 
function FileListTable({archive, diffArchiveId, entries, search, mode, changeCurrentDirectory}) {
    const lowercaseSearch = search.split(' ')[0].toLowerCase();
    return (
        <Table striped bordered hover size={'sm'} responsive>
            <thead>
            <tr>
                <th>Path</th>
                <th></th>
                <th>Size</th>
                <th>Mode</th>
                <th>Modified time</th>
            </tr>
            </thead>
            <tbody>
            {entries
                .map((entry, index) => <FileListEntry
                    archive={archive}
                    diffArchiveId={diffArchiveId}
                    entry={entry}
                    search={lowercaseSearch}
                    mode={mode}
                    changeCurrentDirectory={changeCurrentDirectory}
                    key={index}
                />)}
            </tbody>
        </Table>
    );
}
 
FileListTable.propTypes = {
    diffArchiveId: PropTypes.string,
    entries: PropTypes.array,
    search: PropTypes.string,
    mode: PropTypes.string,
    changeCurrentDirectory: PropTypes.func.isRequired
};
 
FileListTable.defaultProps = {
    entries: [],
    search: '',
    mode: 'flat'
};
 
export default FileListTable;