LogPathChild.tsx 895 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
import * as React from 'react';

interface LogpathChildProps {
    eachLogpath: string;
    logName: string;
}

class LogPathChild extends React.Component<LogpathChildProps, {}> {
    constructor(props: LogpathChildProps) {
        super(props);
    }

Lijiao's avatar
Lijiao committed
13
    render(): React.ReactNode {
14
15
16
17
        const { eachLogpath, logName } = this.props;
        const isLink = /^http/gi.test(eachLogpath);

        return (
18
19
20
            <div className='logpath'>
                <span className='logName'>{logName}</span>
                {isLink ? (
Lijiaoa's avatar
Lijiaoa committed
21
                    <a className='fontColor333 logHref' rel='noopener noreferrer' href={eachLogpath} target='_blank'>
22
23
24
                        {eachLogpath}
                    </a>
                ) : (
Lijiaoa's avatar
Lijiaoa committed
25
                    <span className='fontColor333'>{eachLogpath}</span>
26
                )}
27
28
29
30
31
32
            </div>
        );
    }
}

export default LogPathChild;