import { css, cx } from '@emotion/css'; import React, { useState } from 'react'; import { GroupBase } from 'react-select'; import { GrafanaTheme2 } from '@grafana/data'; import { stylesFactory, useTheme2 } from '../../themes'; import { Select } from '../Select/Select'; import { SelectContainerProps, SelectContainer as BaseSelectContainer } from '../Select/SelectContainer'; import { SelectCommonProps } from '../Select/types'; interface InlineSelectProps extends SelectCommonProps { label?: string; } export function InlineSelect({ label: labelProp, ...props }: InlineSelectProps) { const theme = useTheme2(); const [id] = useState(() => Math.random().toString(16).slice(2)); const styles = getSelectStyles(theme); const components = { SelectContainer, ValueContainer, SingleValue: ValueContainer, }; return (
{labelProp && ( )} {/* @ts-ignore */}