diff options
| author | Haishan <[email protected]> | 2020-04-26 17:35:03 +0800 |
|---|---|---|
| committer | Haishan <[email protected]> | 2020-04-26 17:59:02 +0800 |
| commit | 94e2b1e3985f8f4cfeb26a43c59cada184c7d4aa (patch) | |
| tree | 2d88e5e3ace986e1c08f3eca5e787d1339249dd2 /src/components/shared/Select.tsx | |
| parent | 7cdbba5bf47062f80a0dc7d80a62ff977d4f568e (diff) | |
feat: allow change proxies sorting in group
Diffstat (limited to 'src/components/shared/Select.tsx')
| -rw-r--r-- | src/components/shared/Select.tsx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/components/shared/Select.tsx b/src/components/shared/Select.tsx new file mode 100644 index 0000000..03ac084 --- /dev/null +++ b/src/components/shared/Select.tsx @@ -0,0 +1,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> + ); +} |
