33 lines
810 B
JavaScript
33 lines
810 B
JavaScript
import React from 'react';
|
|
|
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
|
|
import Graph from './Graph.js';
|
|
import './Service.css';
|
|
|
|
const Service = ({ graph, name, status, latency, description }) => (
|
|
<div className="service">
|
|
<header>
|
|
<div className="emoji">
|
|
<FontAwesomeIcon
|
|
icon={`${status ? 'check' : 'exclamation'}-circle`}
|
|
style={{ color: status ? '#2ECC40' : '#FF4136' }}
|
|
/>
|
|
</div>
|
|
<h2 className="title">
|
|
{name} {latency ? (
|
|
<span className="latency">
|
|
{latency}ms
|
|
</span>
|
|
) : null}
|
|
</h2>
|
|
</header>
|
|
<p className="description">
|
|
{description}
|
|
</p>
|
|
{graph ? <Graph width={500} height={175} data={graph} /> : null}
|
|
</div>
|
|
);
|
|
|
|
export default Service;
|