<commit_before>import React from 'react';
import {Link} from 'react-router';

import {DCOSStore} from 'foundation-ui';
import HealthBar from './HealthBar';
import PageHeaderBreadcrumbs from '../../../../../src/js/components/NewPageHeaderBreadcrumbs';

function getHealthStatus(serviceID) {
  if (serviceID == null) {
    return null;
  }

  const service = DCOSStore.serviceTree.findItemById(serviceID);

  if (service == null) {
    return null;
  }

  const serviceStatus = service.getStatus();
  const tasksSummary = service.getTasksSummary();
  const runningTasksCount = tasksSummary.tasksRunning;
  const instancesCount = service.getInstancesCount();
  const isDeploying = serviceStatus === 'Deploying';

  return (
    <div className="service-page-header-status page-header-breadcrumb-content-secondary muted">
      {`${serviceStatus} (${runningTasksCount} of ${instancesCount})`}
      <HealthBar isDeploying={isDeploying}
        tasksSummary={tasksSummary}
        instancesCount={instancesCount}/>
    </div>
  );
}

const ServiceBreadcrumbs = ({serviceID, taskID, taskName}) => {

  const trimmedServiceID = decodeURIComponent(serviceID).replace(/^\//, '');
  const ids = trimmedServiceID.split('/');
  let aggregateIDs = '';

  const crumbs = [<commit_msg>Use ServiceStatusWarning in service breadcrumbs<commit_after>import React from 'react';
import {Link} from 'react-router';

import {DCOSStore} from 'foundation-ui';
import HealthBar from './HealthBar';
import PageHeaderBreadcrumbs from '../../../../../src/js/components/NewPageHeaderBreadcrumbs';
import ServiceStatusWarning from './ServiceStatusWarning';

function getHealthStatus(serviceID) {
  if (serviceID == null) {
    return null;
  }

  const service = DCOSStore.serviceTree.findItemById(serviceID);

  if (service == null) {
    return null;
  }

  const serviceStatus = service.getStatus();
  const tasksSummary = service.getTasksSummary();
  const runningTasksCount = tasksSummary.tasksRunning;
  const instancesCount = service.getInstancesCount();
  const isDeploying = serviceStatus === 'Deploying';

  return (
    <div className="service-page-header-status page-header-breadcrumb-content-secondary muted">
      {`${serviceStatus} (${runningTasksCount} of ${instancesCount})`}
      <ServiceStatusWarning item={service} showDebugInstruction={true} />
      <HealthBar isDeploying={isDeploying}
        tasksSummary={tasksSummary}
        instancesCount={instancesCount}/>
    </div>
  );
}

const ServiceBreadcrumbs = ({serviceID, taskID, taskName}) => {

  const trimmedServiceID = decodeURIComponent(serviceID).replace(/^\//, '');
  const ids = trimmedServiceID.split('/');
  let aggregateIDs = '';

  const crumbs = [
{'fraction_non_alphanumeric': 0.13604436229205175, 'fraction_numerical': 0.0, 'mean_word_length': 4.5, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6199227', 'n_tokens_mistral': 795, 'n_tokens_neox': 789, 'n_words': 171}