import {Fragment} from 'react'; import {DraggableSyntheticListeners, UseDraggableArguments} from '@dnd-kit/core'; import styled from '@emotion/styled'; import {Button} from 'sentry/components/button'; import {IconDelete, IconGrabbable} from 'sentry/icons'; import {t} from 'sentry/locale'; import {space} from 'sentry/styles/space'; import {QueryFieldValue} from 'sentry/utils/discover/fields'; import {QueryField as TableQueryField} from 'sentry/views/discover/table/queryField'; import {FieldValueKind} from 'sentry/views/discover/table/types'; export interface QueryFieldProps { fieldOptions: React.ComponentProps['fieldOptions']; onChange: (newValue: QueryFieldValue) => void; value: QueryFieldValue; attributes?: UseDraggableArguments['attributes']; canDelete?: boolean; canDrag?: boolean; forwardRef?: React.Ref; isDragging?: boolean; listeners?: DraggableSyntheticListeners; onDelete?: () => void; style?: React.CSSProperties; } export function QueryField({ onDelete, onChange, fieldOptions, value, forwardRef, listeners, attributes, canDelete, canDrag, style, isDragging, }: QueryFieldProps) { return ( {isDragging ? null : ( {canDrag && ( } size="zero" borderless /> )} option.value.kind !== FieldValueKind.FUNCTION} /> {canDelete && (