elstat/priv/frontend/src/Service.js

28 lines
619 B
JavaScript
Raw Normal View History

2018-06-12 21:56:50 +00:00
import React from 'react';
import Graph from './Graph.js';
import './Service.css';
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">
{status ? '✅' : '🚫'}
</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
</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>
{graph ? <Graph width={500} height={175} data={graph} /> : null}
2018-06-12 21:56:50 +00:00
</div>
);
2018-06-12 21:56:50 +00:00
export default Service;