aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/code/components/Components.js
blob: d2dffb6786966ade8d1fcb5eb1b86db5d874699b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import React from 'react';

import Component from './Component';
import ComponentsEmpty from './ComponentsEmpty';


const Components = ({ baseComponent, components, coverageMetric, onBrowse }) => (
    <table className="data zebra">
      <thead>
        <tr>
          <th className="thin nowrap">&nbsp;</th>
          <th>&nbsp;</th>
          <th className="thin nowrap text-right">{window.t('metric.ncloc.name')}</th>
          <th className="thin nowrap text-right">{window.t('metric.sqale_index.short_name')}</th>
          <th className="thin nowrap text-right">{window.t('metric.violations.name')}</th>
          <th className="thin nowrap text-right">{window.t('metric.coverage.name')}</th>
          <th className="thin nowrap text-right">{window.t('metric.duplicated_lines_density.short_name')}</th>
        </tr>
      </thead>
      <tbody>
        <Component
            key={baseComponent.uuid}
            component={baseComponent}
            coverageMetric={coverageMetric}/>
        <tr className="blank">
          <td colSpan="7">&nbsp;</td>
        </tr>
      </tbody>
      <tbody>
        {components.length ? (
            components.map(component => (
                <Component
                    key={component.uuid}
                    component={component}
                    coverageMetric={coverageMetric}
                    onBrowse={onBrowse}/>
            ))
        ) : (
            <ComponentsEmpty/>
        )}
      </tbody>
    </table>
);


export default Components;