/** @format */

import * as React from 'react';
import Select, {SelectProps} from './select';
import {useDataApiComboList} from '../../service/dataApi';
interface Iprops extends SelectProps {
    query_type_id?: number | '';
}
export default React.forwardRef((props: Iprops, ref) => {
    const {query_type_id, ...rest} = props;

    const [comboListState, requestComboList] = useDataApiComboList();
    React.useEffect(() => {
        if (props.query_type_id) {
            requestComboList(props.query_type_id);
        }
    }, [props.query_type_id]);
    return (
        <Select
            ref={ref}
            options={comboListState.dataSource}
            placeholder='请选择套餐'
            loading={comboListState.loading}
            {...rest}
        />
    );
});
