Files
pdfer/components/Select.tsx
2021-02-25 00:35:03 +01:00

29 lines
543 B
TypeScript

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