/** * WordPress dependencies */ /** * External dependencies */ import { AsyncPaginate } from 'react-select-async-paginate'; import type { AsyncPaginateProps } from 'react-select-async-paginate'; import type { GroupBase } from 'react-select'; /** * Internal dependencies */ import './style.scss'; import { DEFAULT_STYLE } from '../stylized-select-control'; type AdditionalArgs = { readonly page: number; }; export type AsyncSelectControlProps< OptionType > = { readonly className?: string; readonly disabled?: boolean; } & Omit< AsyncPaginateProps< OptionType, GroupBase< OptionType >, AdditionalArgs, false >, 'theme' | 'isDisabled' | 'className' | 'isMulti' >; export function AsyncSelectControl< OptionType >( { className = '', disabled, styles, ...props }: AsyncSelectControlProps< OptionType > ): JSX.Element { return ( ( { ...theme, spacing: { ...theme.spacing, baseUnit: 0, controlHeight: 48, }, } ) } { ...props } /> ); }