const React = require('react');
const ReactRouter = require('react-router');
const Anchor = require('@ui/components/anchor');
const List = require('@ui/components/list');
const PropTypes = require('@root/prop-types');
const {
Link
} = ReactRouter;
const {
ListItem,
ListItemView,
ListItemMeta,
ListItemTitle,
ListItemSubTitle,
ListItemDescription,
ListItemGroupView,
ListItemOutlet,
ListItemOptions,
ListItemHeader
} = List;
const ServiceItem = ({
org = '',
project = '',
service = {}
}) => {
const to = `/${org}/projects/${project}/services/${service.id}`;
const childs = service.services.map((service) => (
1}
>
{service.name}
{service.instances} instances
Metrics
));
const view = childs.length ? (
{childs}
) : (
Flags
Metrics
);
return (
{Anchor.fn(
{service.name}
)}
{service.instances} instance
…
{view}
);
};
ServiceItem.propTypes = {
org: React.PropTypes.string,
project: React.PropTypes.string,
service: PropTypes.service
};
module.exports = ServiceItem;