2017-10-02 22:36:59 +00:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
import Dropdown from './Dropdown';
|
|
|
|
|
|
|
|
interface Props {
|
2017-10-04 17:51:37 +00:00
|
|
|
value: string | undefined;
|
2017-10-02 22:36:59 +00:00
|
|
|
options: string[];
|
|
|
|
ariaLabel?: string;
|
|
|
|
onChange(value: string): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default class SimpleDropdown extends Component<Props, void> {
|
|
|
|
public render() {
|
|
|
|
const { options, value, onChange, ariaLabel } = this.props;
|
|
|
|
|
|
|
|
const StringDropdown = Dropdown as new () => Dropdown<string>;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<StringDropdown
|
|
|
|
options={options}
|
|
|
|
value={value}
|
|
|
|
onChange={onChange}
|
2017-10-04 17:51:37 +00:00
|
|
|
ariaLabel={ariaLabel || 'dropdown'}
|
2017-10-02 22:36:59 +00:00
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|