27 lines
611 B
TypeScript
27 lines
611 B
TypeScript
import React, { PureComponent } from 'react';
|
|
import Dropdown from './Dropdown';
|
|
|
|
interface Props {
|
|
value: string | undefined;
|
|
options: string[];
|
|
ariaLabel?: string;
|
|
onChange(value: string): void;
|
|
}
|
|
|
|
export default class SimpleDropdown extends PureComponent<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}
|
|
ariaLabel={ariaLabel || 'dropdown'}
|
|
/>
|
|
);
|
|
}
|
|
}
|