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

Kai Reinhard
16.02.2018 0473052c536df2adc13534bd9cfdffd5ad541c1c
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
import React from 'react';
import PropTypes from 'prop-types';
import {Table} from 'reactstrap';
import FileListEntry from './FileListEntry';
 
function FileListTable({entries, search}) {
    const lowercaseSearch = search.toLowerCase();
    return (
        <Table striped bordered hover size={'sm'} responsive>
            <thead>
            <tr>
                <th>Mode</th>
                <th>Modified time</th>
                <th>Size</th>
                <th>Path</th>
            </tr>
            </thead>
            <tbody>
            {entries
                .filter(entry => [entry.message]
                    .join('|#|').toLowerCase()
                    .indexOf(lowercaseSearch) !== -1)
                .map((entry, index) => <FileListEntry
                    entry={entry}
                    search={lowercaseSearch}
                    key={index}
                />)}
            </tbody>
        </Table>
    );
}
 
FileListTable.propTypes = {
    entries: PropTypes.array,
    search: PropTypes.string
};
 
FileListTable.defaultProps = {
    entries: [],
    search: ''
};
 
export default FileListTable;