From 55f17c4ef645e8f6852925269b15f596853faa90 Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Mon, 22 Sep 2025 11:45:41 +0800 Subject: [PATCH] Temporary component --- src/components/Combobox/Combobox.tsx | 41 ++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/components/Combobox/Combobox.tsx 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() && ( + + )} + + ) +}