import React, {ReactNode} from 'react';
import CustomRadioSelect from "./CustomRadioSelect";
import {CustomSelectOptions} from "../../../models/ReactComponents";
import SelectItem from "./SelectItem";

type MakeCustomRadioSelectProps = {
    options: CustomSelectOptions
    placeholder?: string
    disabled?: boolean
    handleChange: (n: string) => void
    value?: any
    isLoading?: boolean
    theme?: 'default' | 'service-header' | 'search-listbox'
    hasError?: string
    isForGate?: boolean
    validation?: (v: any) => void
}

const MakeCustomRadioSelect = ({
                                   options,
                                   ...props

                               }: MakeCustomRadioSelectProps) => {



    return (
        <CustomRadioSelect
            {...props}
        >
            {
                options?.map(opt => {
                    return <SelectItem key={opt.value} value={opt.value}>{opt.name}</SelectItem>
                })
            }
        </CustomRadioSelect>
    );
}

export default MakeCustomRadioSelect;