import React from "react"; import BaseControl, { ControlProps } from "./BaseControl"; import { Button, MenuItem } from "@blueprintjs/core"; import { IItemRendererProps } from "@blueprintjs/select"; import { StyledDropDown, StyledDropDownContainer, DropdownStyles, } from "./StyledControls"; import { ControlIcons, ControlIconName } from "icons/ControlIcons"; import { DropdownOption } from "widgets/DropdownWidget"; import styled from "styled-components"; const MenuItemWrapper = styled(MenuItem)` z-index: 2; &&&& span { width: auto; font-size: 12px; line-height: 20px; color: #2e3d49; } &&&& div:first-child { flex: none; } `; class DropDownControl extends BaseControl { render() { const selected: DropdownOption | undefined = this.props.options.find( (option) => option.value === this.props.propertyValue, ); const controlIconName: ControlIconName = selected && selected.icon ? selected.icon : -1; const ControlIcon = controlIconName !== -1 ? ControlIcons[controlIconName] : null; return ( } popoverProps={{ minimal: true, usePortal: true, popoverClassName: "select-popover-wrapper", }} >