moderator-toolbox-nxg-for-reddit / modules/macros/components/MacroSelect
modules/macros/components/MacroSelect¶
Functions¶
MacroSelect()¶
MacroSelect(
__namedParameters):Element|null
Defined in: extension/data/modules/macros/components/MacroSelect.tsx:42
Renders a macro picker that is filtered to the given context type and subreddit.
Parameters¶
__namedParameters¶
Returns¶
Element | null
Interfaces¶
MacroSelectProps¶
Defined in: extension/data/modules/macros/components/MacroSelect.tsx:20
Props for the MacroSelect component.
Properties¶
label?¶
optionallabel?:string
Defined in: extension/data/modules/macros/components/MacroSelect.tsx:38
Label text shown as the placeholder option and button caption.
onSelectMacro¶
onSelectMacro: (
macro,dropdown,reset) =>Promise<void>
Defined in: extension/data/modules/macros/components/MacroSelect.tsx:31
Called when the user picks a macro.
Parameters¶
macro¶
The selected macro configuration.
dropdown¶
Element
The host element of the select control (used to position the edit popup).
reset¶
() => void
Resets the select back to the placeholder option.
Returns¶
Promise<void>
presentation?¶
optionalpresentation?:"select"|"button"
Defined in: extension/data/modules/macros/components/MacroSelect.tsx:36
How to render the control - 'select' shows a plain <select>, while 'button' overlays
a transparent select on top of a styled button.
subreddit¶
subreddit:
string
Defined in: extension/data/modules/macros/components/MacroSelect.tsx:22
The subreddit whose macro configuration should be loaded.
type¶
type:
"post"|"comment"|"modmail"
Defined in: extension/data/modules/macros/components/MacroSelect.tsx:24
The context type used to filter which macros are shown.