11import { CodeBracketIcon , DocumentIcon } from '@heroicons/react/24/outline' ;
2+ import Badge from '@node-core/ui-components/Common/Badge' ;
23import MetaBar from '@node-core/ui-components/Containers/MetaBar' ;
34import GitHubIcon from '@node-core/ui-components/Icons/Social/GitHub' ;
45
@@ -11,13 +12,16 @@ const iconMap = {
1112
1213/**
1314 * @typedef MetaBarProps
14- * @property {Array<import('@vcarl/remark-headings').Heading> } headings - Array of page headings for table of contents
15+ * @property {Array<import('@vcarl/remark-headings').Heading & { stability: string } > } headings - Array of page headings for table of contents
1516 * @property {string } addedIn - Version or date when feature was added
1617 * @property {string } readingTime - Estimated reading time for the page
1718 * @property {Array<[string, string]> } viewAs - Array of [title, path] tuples for view options
1819 * @property {string } editThisPage - URL for editing the current page
1920 */
2021
22+ const STABILITY_KINDS = [ 'error' , 'warning' , null , 'default' ] ;
23+ const STABILITY_LABELS = [ 'D' , 'E' , null , 'L' ] ;
24+
2125/**
2226 * MetaBar component that displays table of contents and page metadata
2327 * @param {MetaBarProps } props - Component props
@@ -32,8 +36,23 @@ export default ({
3236 < MetaBar
3337 heading = "Table of Contents"
3438 headings = { {
35- items : headings . map ( ( { slug, ...heading } ) => ( {
39+ items : headings . map ( ( { slug, value , stability , ...heading } ) => ( {
3640 ...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+ ) ,
3756 data : { id : slug } ,
3857 } ) ) ,
3958 } }
0 commit comments