-
Notifications
You must be signed in to change notification settings - Fork 4
/
left.jsx
34 lines (30 loc) · 818 Bytes
/
left.jsx
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
import Desktop from './lib/Desktop/index.jsx';
import Error from './lib/Error/index.jsx';
import { leftSide } from './lib/style.jsx';
import parse from './lib/parse.jsx';
export const refreshFrequency = 500
export const command = './powerbar/status-left.sh'
export const render = ({output}) => {
console.log(`Left bar output: ${output}`);
const data = parse(output);
if (typeof data === 'undefined') {
return (
<div style={leftSide}>
<Error msg="Error: unknown script output" side="left"/>
</div>
)
}
if (typeof data.error !== 'undefined') {
return (
<div style={leftSide}>
<Error msg={`Error: ${data.error}`} side="left"/>
</div>
)
}
return (
<div style={leftSide}>
<Desktop output={data.desktop}/>
</div>
)
}
export default null