-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathindex.jsx
More file actions
37 lines (35 loc) · 991 Bytes
/
index.jsx
File metadata and controls
37 lines (35 loc) · 991 Bytes
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
import BadgeGroup from '@node-core/ui-components/Common/BadgeGroup';
const STABILITY_KINDS = ['error', 'warning', 'default', 'info'];
/**
* Renders the module stability overview table.
* @param {{ entries: Array<{ api: string, name: string, stabilityIndex: number, stabilityDescription: string }> }} props
*/
export default ({ entries = [] }) => (
<table>
<thead>
<tr>
<th>API</th>
<th>Stability</th>
</tr>
</thead>
<tbody>
{entries.map(({ api, name, stabilityIndex, stabilityDescription }) => (
<tr key={api}>
<td>
<a href={`${api}.html`}>{name}</a>
</td>
<td>
<BadgeGroup
as="span"
size="small"
kind={STABILITY_KINDS[stabilityIndex] ?? 'success'}
badgeText={stabilityIndex}
>
{stabilityDescription}
</BadgeGroup>
</td>
</tr>
))}
</tbody>
</table>
);