11import { CodeBracketIcon , DocumentIcon } from '@heroicons/react/24/outline' ;
2- import Badge from '@node-core/ui-components/Common/Badge' ;
32import MetaBar from '@node-core/ui-components/Containers/MetaBar' ;
43import GitHubIcon from '@node-core/ui-components/Icons/Social/GitHub' ;
54
@@ -12,16 +11,19 @@ const iconMap = {
1211
1312/**
1413 * @typedef MetaBarProps
15- * @property {Array<import('@vcarl/remark-headings').Heading & { stability: string }> } headings - Array of page headings for table of contents
14+ * @property {Array<import('@vcarl/remark-headings').Heading & { stability: number }> } headings - Array of page headings for table of contents
1615 * @property {string } addedIn - Version or date when feature was added
1716 * @property {string } readingTime - Estimated reading time for the page
1817 * @property {Array<[string, string]> } viewAs - Array of [title, path] tuples for view options
1918 * @property {string } editThisPage - URL for editing the current page
2019 */
2120
22- const STABILITY_KINDS = [ 'error' , 'warning' , null , 'info' ] ;
23- const STABILITY_LABELS = [ 'D' , 'E' , null , 'L' ] ;
24-
21+ const STABILITY_CLASS_MAP = [
22+ styles . deprecated ,
23+ styles . experimental ,
24+ undefined ,
25+ styles . legacy ,
26+ ] ;
2527/**
2628 * MetaBar component that displays table of contents and page metadata
2729 * @param {MetaBarProps } props - Component props
@@ -38,21 +40,7 @@ export default ({
3840 headings = { {
3941 items : headings . map ( ( { slug, value, stability, ...heading } ) => ( {
4042 ...heading ,
41- value :
42- stability !== 2 ? (
43- < >
44- { value }
45- < Badge
46- size = "small"
47- className = { styles . badge }
48- kind = { STABILITY_KINDS [ stability ] }
49- >
50- { STABILITY_LABELS [ stability ] }
51- </ Badge >
52- </ >
53- ) : (
54- value
55- ) ,
43+ value : < span className = { STABILITY_CLASS_MAP [ stability ] } > { value } </ span > ,
5644 data : { id : slug } ,
5745 } ) ) ,
5846 } }
0 commit comments