11import { useCallback , useEffect , useState } from 'react' ;
22import { useDocumentTitle } from '@mantine/hooks' ;
3- import { Stack , Box , TextInput , Text , Select , Button , Center , Stepper , Badge } from '@mantine/core' ;
3+ import { Stack , Box , TextInput , Text , Select , Button , Center , Stepper , Badge , SelectProps , Group } from '@mantine/core' ;
44import { IconTrashX , IconX } from '@tabler/icons-react' ;
55import {
66 PRIMARY_HEADER_HEIGHT ,
@@ -22,7 +22,7 @@ import RefreshNow from '@/components/Header/RefreshNow';
2222import MultiEventTimeLineGraph from './components/MultiEventTimeLineGraph' ;
2323import { CorrelationEmptyPlaceholder } from './components/CorrelationEmptyPlaceholder' ;
2424import { StreamSelectBox } from './components/StreamSelectBox' ;
25- import { CorrelationFieldItem } from './components/CorrelationFieldItem' ;
25+ import { CorrelationFieldItem , dataTypeIcons } from './components/CorrelationFieldItem' ;
2626import { MaximizeButton } from '../Stream/components/PrimaryToolbar' ;
2727import ShareButton from './components/ShareButton' ;
2828import useParamsController from './hooks/useParamsController' ;
@@ -231,6 +231,26 @@ const Correlation = () => {
231231 setCorrelationData ( ( store ) => toggleSaveCorrelationModal ( store , true ) ) ;
232232 } , [ ] ) ;
233233
234+ const renderJoinOneOptions : SelectProps [ 'renderOption' ] = ( { option } ) => {
235+ const fieldType = fields [ streamNames [ 0 ] ] ?. fieldTypeMap [ option . value ] ;
236+ return (
237+ < div style = { { display : 'flex' , justifyContent : 'space-between' , width : '100%' } } >
238+ { option . label }
239+ { dataTypeIcons ( 'black' ) [ fieldType ] }
240+ </ div >
241+ ) ;
242+ } ;
243+
244+ const renderJoinTwoOptions : SelectProps [ 'renderOption' ] = ( { option } ) => {
245+ const fieldType = fields [ streamNames [ 1 ] ] ?. fieldTypeMap [ option . value ] ;
246+ return (
247+ < div style = { { display : 'flex' , justifyContent : 'space-between' , width : '100%' } } >
248+ { option . label }
249+ { dataTypeIcons ( 'black' ) [ fieldType ] }
250+ </ div >
251+ ) ;
252+ } ;
253+
234254 // View Flags
235255 const hasContentLoaded = ! schemaLoading && ! loadingState && ! streamsLoading && ! multipleSchemasLoading ;
236256 const hasNoData = hasContentLoaded && ! errorMessage && pageData . length === 0 ;
@@ -442,6 +462,7 @@ const Correlation = () => {
442462 }
443463 value = { select1Value }
444464 onChange = { ( value ) => handleFieldChange ( value , true ) }
465+ renderOption = { renderJoinOneOptions }
445466 />
446467 </ div >
447468 < Text size = "md" > = </ Text >
@@ -462,6 +483,7 @@ const Correlation = () => {
462483 }
463484 value = { select2Value }
464485 onChange = { ( value ) => handleFieldChange ( value , false ) }
486+ renderOption = { renderJoinTwoOptions }
465487 />
466488 </ div >
467489 < div style = { { height : '100%' , width : '20%' , display : 'flex' } } >
0 commit comments