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

Kai Reinhard
19.29.2022 9926a79503c9bd6454c076f2b60cd577f6061e4d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import React from 'react';
import PropTypes from 'prop-types';
import Highlight from 'react-highlighter';
 
function LogEntry({entry, search, locationString, showStackTrace}) {
    let message = (showStackTrace === 'true' && entry.stackTrace) ? entry.message + <br/> + entry.stackTrace : entry.message;
    return (
        <tr>
            <td className={'tt'}>{entry.logDate}</td>
            <td className={`tt log-${entry.level}`}><Highlight search={search}>{entry.level}</Highlight></td>
            <td className={'tt'}><Highlight search={search}>{message}</Highlight></td>
            {locationString ? <td className={'tt log-location'}><Highlight search={search}>{locationString}</Highlight></td> : undefined}
        </tr>
    );
}
 
LogEntry.propTypes = {
    entry: PropTypes.shape({}).isRequired,
    search: PropTypes.string,
    locationString: PropTypes.string,
    showStackTrace: PropTypes.oneOf(['true', 'false'])
};
 
export default LogEntry;