import React from 'react'
import { Select } from 'antd';
const { Option } = Select;

const SearchOptionsTow = (porps:any) => {

    const {list,extendName,def} = porps;
    const options = list.map((d:any,index:number) => <Option value={d} key={index}>{d}</Option>);
    function onChange(value:any) {
        // console.log(`selected ${value}`);
        extendName(value)
    }


    return (
        <div>
            <Select
                showSearch
                style={{ width: 200 }}
                placeholder="Community Name"
                optionFilterProp="children"
                onChange={onChange}
                defaultValue={def}
            >
                {options}
            </Select>
        </div>
    )
}

export default SearchOptionsTow
