import type { PopupProps } from '../Popup' import { clsx } from 'clsx' import { createSignal, For, Show } from 'solid-js' import { Popup } from '../Popup' import styles from './DropDown.module.scss' export type Option = { value: string | number title: string } type Props = { class?: string popupProps?: Partial options: TOption[] currentOption: TOption triggerCssClass?: string onChange: (option: TOption) => void } const Chevron = (props: { class?: string }) => { return ( ) } export const DropDown = (props: Props) => { const [isPopupVisible, setIsPopupVisible] = createSignal(false) return ( {props.currentOption.title}{' '} } variant="tiny" onVisibilityChange={(isVisible) => setIsPopupVisible(isVisible)} {...props.popupProps} > {(option) => (
props.onChange(option)} > {option.title}
)}
) }