@@ -55,6 +55,8 @@ export interface ActionMenuProps extends React.ComponentProps<"div"> {
55
55
renderReference : (
56
56
props : React . HTMLProps < HTMLButtonElement > ,
57
57
) => React . ReactElement ;
58
+ /** Footer to display helper text or other content below the options */
59
+ footer ?: React . ReactNode ;
58
60
}
59
61
60
62
const ActionMenu : React . FunctionComponent < ActionMenuProps > = ( {
@@ -70,6 +72,7 @@ const ActionMenu: React.FunctionComponent<ActionMenuProps> = ({
70
72
options,
71
73
position = "bottom-end" ,
72
74
renderReference,
75
+ footer,
73
76
...rest
74
77
} : ActionMenuProps ) => {
75
78
const actionMenuOptions = options . map ( ( option ) : OptionType => {
@@ -81,7 +84,7 @@ const ActionMenu: React.FunctionComponent<ActionMenuProps> = ({
81
84
82
85
const [ showMenu , setShowMenu ] = React . useState ( isOpen ) ;
83
86
const [ currentFocusedOption , setCurrentFocusedOption ] =
84
- React . useState < OptionType > ( ) ;
87
+ React . useState < OptionType > ( ) ;
85
88
86
89
const isOptionDisabled = ( option : OptionType | undefined ) : boolean => {
87
90
if ( option ?. type === "list" ) {
@@ -138,7 +141,7 @@ const ActionMenu: React.FunctionComponent<ActionMenuProps> = ({
138
141
const enabledOptions = actionMenuOptions . filter (
139
142
option => ! isOptionDisabled ( option )
140
143
) ;
141
- if ( ! enabledOptions . length ) { return ; }
144
+ if ( ! enabledOptions . length ) { return ; }
142
145
143
146
let currentFocusedIndex = - 1 ;
144
147
if ( currentFocusedOption ) {
@@ -265,6 +268,7 @@ const ActionMenu: React.FunctionComponent<ActionMenuProps> = ({
265
268
className : "ids-action-menu__trigger"
266
269
} ) ;
267
270
} }
271
+ footer = { footer }
268
272
/>
269
273
</ div >
270
274
) ;
0 commit comments