import type { ElementType } from 'react' ; import React from 'react' ; import styled from 'styled-components' ; const Container = styled . div `
  display: flex;
  flex-grow: 1;
` ; const Label = styled . div `
  flex-grow: 0;
  color: hsl(0, 0%, 80%);
` ; const SelectedValueLabel = styled . div `
  flex-grow: 1;
  padding-left: 8px;
` ; type Option = { label : string ; value : string ; } ; const BasicSelect = ( props ) => { const selectedValue = typeof props . value === 'string' ? props . value : props . defaultOption ; const selectedLabel = props . options . find ( ( opt ) => opt . value === selectedValue ) ?. label ; return ( < Container > < Label > { props . label } < /Label> < SelectedValueLabel > { selectedLabel } { } < /SelectedValueLabel> < /Container>); } ; export default BasicSelect ;