diff --git a/src/components/Combobox/Combobox.tsx b/src/components/Combobox/Combobox.tsx new file mode 100644 index 0000000..dae1cf6 --- /dev/null +++ b/src/components/Combobox/Combobox.tsx @@ -0,0 +1,41 @@ +import Input from '../../../fwt/components/Input' +import { createSignal } from 'solid-js' + +interface Props { + placeholder?: string + value?: string + onChange?: (value: string) => void + options: string[] +} + +export default (props: Props) => { + const [sample, setSample] = createSignal(props.value || '') + const [isOpen, setIsOpen] = createSignal(false) + const [selectedOption, setSelectedOption] = createSignal('') + + const handleInputChange = (val: string) => { + setSample(val) + setSelectedOption('') + setIsOpen(true) + } + + const handleSelectOption = (option: string) => { + setSelectedOption(option) + setSample(option) + setIsOpen(false) + props.onChange?.(option) + } + + return ( + <> + + {isOpen() && ( +