File tree 2 files changed +15
-3
lines changed
2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,8 @@ function GroupListItem({
127
127
isExpanded = { hasActionMenu ? isExpanded : false }
128
128
isSelected = { isSelected }
129
129
isSubmenuVisible = { hasActionMenu ? isExpanded : undefined }
130
- label = {
130
+ label = { group . name }
131
+ richLabel = {
131
132
< div className = "grow flex items-center justify-between gap-x-2" >
132
133
{ group . name }
133
134
< GroupIcon type = { group . type } />
Original file line number Diff line number Diff line change @@ -101,7 +101,17 @@ export type MenuItemProps = {
101
101
*/
102
102
isSubmenuVisible ?: boolean ;
103
103
104
- label : ComponentChildren ;
104
+ /**
105
+ * Main text of the menu item.
106
+ * This is also used as part of the submenu toggle's title, if any.
107
+ */
108
+ label : string ;
109
+
110
+ /**
111
+ * An alternative to `label`, in case you need to render more complex/rich
112
+ * content in this item.
113
+ */
114
+ richLabel ?: ComponentChildren ;
105
115
106
116
/**
107
117
* Optional content to render into a left channel. This accommodates small
@@ -146,6 +156,7 @@ export default function MenuItem({
146
156
isSubmenuItem,
147
157
isSubmenuVisible,
148
158
label,
159
+ richLabel = label ,
149
160
leftChannelContent,
150
161
onClick,
151
162
onToggleSubmenu,
@@ -214,7 +225,7 @@ export default function MenuItem({
214
225
</ div >
215
226
) }
216
227
< span className = "flex items-center grow whitespace-nowrap px-1" >
217
- { label }
228
+ { richLabel }
218
229
</ span >
219
230
{ hasRightContent && (
220
231
< div
You can’t perform that action at this time.
0 commit comments