SimpleDropdown.tsx 673 B

123456789101112131415161718192021222324252627
  1. import React, { SFC } from 'react';
  2. interface Props {
  3. onValueChange: any;
  4. options: any;
  5. value: string;
  6. label: string;
  7. }
  8. const SimpleDropdown: SFC<Props> = props => {
  9. return (
  10. <div className="gf-form max-width-21">
  11. <span className="gf-form-label width-7">{props.label}</span>
  12. <div className="gf-form-select-wrapper max-width-14">
  13. <select className="gf-form-input" required onChange={props.onValueChange}>
  14. {props.options.map((qt, i) => (
  15. <option key={i} value={qt} ng-if="false">
  16. {qt}
  17. </option>
  18. ))}
  19. </select>
  20. </div>
  21. </div>
  22. );
  23. };
  24. export default SimpleDropdown;