drop some types in

This commit is contained in:
Thomas Ruoff
2021-02-14 22:47:44 +01:00
parent 81db4b5d0e
commit 85a7b54a13
13 changed files with 116 additions and 45 deletions

View File

@@ -1,12 +1,22 @@
import React from 'react'
export default (props) => {
const { options = [] } = props
export default function Select({
name,
text,
value,
onchange,
options = [],
}: {
name: string
text: string
value: string
onchange: () => void
options: { name: string; value: string }[]
}) {
return (
<label>
{props.text}
<select className={props.name} onChange={props.onchange.bind(null, props.name)} value={props.value}>
{text}
<select className={name} onChange={onchange.bind(null, name)} value={value}>
{options.map((option) => (
<option value={option.value} key={option.value}>
{option.name}