Sha256: fc73a65657f8cc4216ba939bcb4ce24ae4708d7e281c9f90b8a071250d20612b

Contents?: true

Size: 916 Bytes

Versions: 10

Compression:

Stored size: 916 Bytes

Contents

import React from 'react';
import PropTypes from 'prop-types';
import Service from './Service';
import { arrayToObjectObj } from '../../../helper';
import { cloneDeep } from 'lodash';

const ServiceCounter= ({
  title,
  serviceList,
}) =>{
  if (serviceList == undefined || serviceList.length == 0) {
    return null;
  }
  const services = cloneDeep(arrayToObjectObj(serviceList, "id"));

  return (
    <div>
      <label className="service-counter-title">{title}</label>
    {Object.keys(services).map(key => (
      <Service
        key={services[key].id}
        name={services[key].name}
        currentCount={services[key].currentCount}
        minCount={Number(services[key].minCount)}
        maxCount={Number(services[key].maxCount)}
      />)
    )}
    </div>
  );
};

ServiceCounter.propTypes = {
  title: PropTypes.string.isRequired,
  serviceList: PropTypes.array,
};

export default ServiceCounter;

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
foreman_acd-0.9.7 webpack/components/ApplicationInstance/components/ServiceCounter.js
foreman_acd-0.9.5 webpack/components/ApplicationInstance/components/ServiceCounter.js
foreman_acd-0.9.4 webpack/components/ApplicationInstance/components/ServiceCounter.js
foreman_acd-0.9.3 webpack/components/ApplicationInstance/components/ServiceCounter.js
foreman_acd-0.9.2.3 webpack/components/ApplicationInstance/components/ServiceCounter.js
foreman_acd-0.9.2.2 webpack/components/ApplicationInstance/components/ServiceCounter.js
foreman_acd-0.9.2.1 webpack/components/ApplicationInstance/components/ServiceCounter.js
foreman_acd-0.9.2 webpack/components/ApplicationInstance/components/ServiceCounter.js
foreman_acd-0.9.1 webpack/components/ApplicationInstance/components/ServiceCounter.js
foreman_acd-0.9.0 webpack/components/ApplicationInstance/components/ServiceCounter.js