blob: 03ac08403df76c705ab2b81996bd3245652f77ea (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
import * as React from 'react';
import s from './Select.module.css';
type Props = {
options: Array<string[]>;
selected: string;
onChange: (event: React.ChangeEvent<HTMLSelectElement>) => any;
};
export default function Select({ options, selected, onChange }: Props) {
return (
<select className={s.select} value={selected} onChange={onChange}>
{options.map(([value, name]) => (
<option key={value} value={value}>
{name}
</option>
))}
</select>
);
}
|