Projekt

Obecné

Profil

Stáhnout (1 KB) Statistiky
| Větev: | Tag: | Revize:
1
import { CheckIcon, FormControl, Select } from "native-base"
2
import MultiSelect from "react-native-multiple-select"
3

    
4
export interface SearchFormProps {
5
    data: { label: string, value: string, key: string }[],
6
    label: string,
7
    placeholder: string,
8
}
9

    
10
const SearchFormControl = (props: SearchFormProps) => {
11
    return (
12
        <FormControl key={props.label}>
13
            <FormControl.Label>{props.label}</FormControl.Label>
14
            <Select
15
                placeholder={props.placeholder}
16
                minWidth="200"
17
                accessibilityLabel="Choose Service"
18
                _selectedItem={{
19
                    bg: "teal.600",
20
                    endIcon: <CheckIcon size={5} />
21
                }}
22
                mt="1"
23
                key={props.label}
24
            >
25
                {props.data.map((row) => (
26
                    <Select.Item label={row.label} value={row.value} key={row.key}/>
27
                ))}
28
            </Select>
29
        </FormControl>
30
    )
31
}
32

    
33
export default SearchFormControl
(3-3/3)