mirror of
https://github.com/tomru/pdfer.git
synced 2026-03-03 14:37:21 +01:00
28 lines
613 B
JavaScript
28 lines
613 B
JavaScript
import { h } from 'preact';
|
|
|
|
export default (props) => {
|
|
|
|
const { options = [] } = props;
|
|
const optionsMarkup = options.map(option => {
|
|
return (
|
|
<option
|
|
label={option.name}
|
|
value={option.value}
|
|
selected={props.value === option.value}
|
|
/>
|
|
);
|
|
});
|
|
|
|
return (
|
|
<label>
|
|
{props.text}
|
|
<select
|
|
class={props.name}
|
|
onchange={props.onchange.bind(null, props.name)}
|
|
>
|
|
{optionsMarkup}
|
|
</select>
|
|
</label>
|
|
);
|
|
}
|