mirror of
https://github.com/tomru/pdfer.git
synced 2026-03-03 14:37:21 +01:00
various styling fixes
This commit is contained in:
27
webapp/views/components/Select.js
Normal file
27
webapp/views/components/Select.js
Normal file
@@ -0,0 +1,27 @@
|
||||
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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user