Minimal working prototype, no mobile, no printing
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { useRef } from 'preact/hooks'
|
||||
import { Icon } from './Icon.jsx'
|
||||
|
||||
export const ComboBox = ({ selected, options }) => {
|
||||
const selectRef = useRef()
|
||||
|
||||
return (
|
||||
<div class="input-combo" onClick={() => selectRef.current?.click()}>
|
||||
<select ref={selectRef}>
|
||||
{options.map(({ label, value }) => (
|
||||
<option value={value} selected={value === selected}>
|
||||
{label}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
<Icon name="expand_more" />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user