SelectRow.tsx 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import React, { Component } from "react";
  2. import styled from "styled-components";
  3. import Selector from "../Selector";
  4. type PropsType = {
  5. label: string;
  6. value: string;
  7. setActiveValue: (x: string) => void;
  8. options: { value: string; label: string }[];
  9. dropdownLabel?: string;
  10. width?: string;
  11. dropdownMaxHeight?: string;
  12. };
  13. type StateType = {};
  14. export default class SelectRow extends Component<PropsType, StateType> {
  15. render() {
  16. return (
  17. <StyledSelectRow>
  18. <Label>{this.props.label}</Label>
  19. <SelectWrapper>
  20. <Selector
  21. activeValue={this.props.value}
  22. setActiveValue={this.props.setActiveValue}
  23. options={this.props.options}
  24. dropdownLabel={this.props.dropdownLabel}
  25. width={this.props.width || "270px"}
  26. dropdownWidth={this.props.width}
  27. dropdownMaxHeight={this.props.dropdownMaxHeight}
  28. />
  29. </SelectWrapper>
  30. </StyledSelectRow>
  31. );
  32. }
  33. }
  34. const SelectWrapper = styled.div``;
  35. const Label = styled.div`
  36. color: #ffffff;
  37. margin-bottom: 10px;
  38. `;
  39. const StyledSelectRow = styled.div`
  40. margin-bottom: 15px;
  41. margin-top: 20px;
  42. `;