2018-06-12 21:56:50 +00:00
|
|
|
import React from 'react';
|
|
|
|
|
2018-07-14 01:57:02 +00:00
|
|
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
|
|
|
2018-06-12 21:56:50 +00:00
|
|
|
import Graph from './Graph.js';
|
|
|
|
import './Service.css';
|
|
|
|
|
2018-07-13 19:07:53 +00:00
|
|
|
const Service = ({ graph, name, status, latency, description }) => (
|
2018-06-12 21:56:50 +00:00
|
|
|
<div className="service">
|
2018-07-14 01:49:45 +00:00
|
|
|
<header>
|
|
|
|
<div className="emoji">
|
2018-07-14 01:57:02 +00:00
|
|
|
<FontAwesomeIcon
|
|
|
|
icon={`${status ? 'check' : 'exclamation'}-circle`}
|
|
|
|
style={{ color: status ? '#2ECC40' : '#FF4136' }}
|
|
|
|
/>
|
2018-07-13 19:07:53 +00:00
|
|
|
</div>
|
2018-07-14 01:49:45 +00:00
|
|
|
<h2 className="title">
|
2018-07-13 19:32:33 +00:00
|
|
|
{name} {latency ? (
|
2018-07-14 01:49:45 +00:00
|
|
|
<span className="latency">
|
2018-07-13 19:32:33 +00:00
|
|
|
{latency}ms
|
2018-07-13 19:07:53 +00:00
|
|
|
</span>
|
|
|
|
) : null}
|
2018-06-12 21:56:50 +00:00
|
|
|
</h2>
|
|
|
|
</header>
|
2018-07-14 01:49:45 +00:00
|
|
|
<p className="description">
|
2018-06-12 21:56:50 +00:00
|
|
|
{description}
|
|
|
|
</p>
|
2018-07-13 19:07:53 +00:00
|
|
|
{graph ? <Graph width={500} height={175} data={graph} /> : null}
|
2018-06-12 21:56:50 +00:00
|
|
|
</div>
|
2018-07-13 19:07:53 +00:00
|
|
|
);
|
2018-06-12 21:56:50 +00:00
|
|
|
|
|
|
|
export default Service;
|