@@ -38,6 +38,8 @@ import { ReactSelectInputAction } from '@Common/Constants'
38
38
import { isNullOrUndefined } from '@Shared/Helpers'
39
39
import { Tooltip } from '@Common/Tooltip'
40
40
import { TooltipProps } from '@Common/Tooltip/types'
41
+ import { ComponentSizeType } from '@Shared/constants'
42
+ import { Button , ButtonVariantType } from '../Button'
41
43
import { SelectPickerGroupHeadingProps , SelectPickerOptionType , SelectPickerProps } from './type'
42
44
import { getGroupCheckboxValue } from './utils'
43
45
@@ -203,14 +205,40 @@ export const SelectPickerOption = <OptionValue, IsMulti extends boolean>({
203
205
export const SelectPickerMenuList = < OptionValue , > ( props : MenuListProps < SelectPickerOptionType < OptionValue > > ) => {
204
206
const {
205
207
children,
206
- selectProps : { inputValue, renderMenuListFooter, shouldRenderCustomOptions, renderCustomOptions } ,
208
+ selectProps : {
209
+ inputValue,
210
+ renderMenuListFooter,
211
+ shouldRenderCustomOptions,
212
+ renderCustomOptions,
213
+ loadMoreButtonConfig,
214
+ } ,
207
215
} = props
208
216
209
217
return (
210
218
< >
211
219
{ /* added key here to explicitly re-render the list on input change so that the top option is rendered */ }
212
220
< components . MenuList { ...props } key = { inputValue } >
213
- < div className = "py-4 cursor" > { shouldRenderCustomOptions ? renderCustomOptions ( ) : children } </ div >
221
+ < div className = "py-4 cursor" >
222
+ { shouldRenderCustomOptions ? (
223
+ renderCustomOptions ( )
224
+ ) : (
225
+ < >
226
+ { children }
227
+ { loadMoreButtonConfig ?. show && (
228
+ < div className = "px-4" >
229
+ < Button
230
+ { ...loadMoreButtonConfig }
231
+ dataTestId = "load-more-previous-deployments"
232
+ variant = { ButtonVariantType . borderLess }
233
+ text = "Load more"
234
+ size = { ComponentSizeType . small }
235
+ fullWidth
236
+ />
237
+ </ div >
238
+ ) }
239
+ </ >
240
+ ) }
241
+ </ div >
214
242
{ /* Added to the bottom of menu list to prevent from hiding when the menu is opened close to the bottom of the screen */ }
215
243
</ components . MenuList >
216
244
{ ! shouldRenderCustomOptions && renderMenuListFooter && (
0 commit comments