Newer
Older
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
// This file is part of Parity.
//
import withHealth, { STATUS } from '../utils/withHealth';
<div className='status'>
<span className={['status_icon', this.statusToClassName()].join(' ')}>
<svg viewBox='0 0 20 20'>
<circle fill='#DDD' cx='10' cy='10' r='10' />
</svg>
<span className='status_text'>{this.statusToFriendlyMessage()}</span>
/**
* Get className from the status icon from the status enum
*/
return '-syncing';
default:
return '-bad';
}
};
switch (status) {
case STATUS.CLOCKNOTSYNC:
return 'Clock not sync';
case STATUS.DOWNLOADING:
return `Downloading... (${payload.percentage}%)`;
case STATUS.NOINTERNET:
return 'No Internet connection';
case STATUS.NOPEERS:
return 'Not connected to any peers';
case STATUS.LAUNCHING:
return 'Launching the node...';
payload && payload.percentage && payload.percentage.gt(0)
? ` (${payload.percentage.toFixed(0)}%)`
: ''
default:
return JSON.stringify(payload); // Just in case payload is an object
}
};