11import { Button , Stack , px , rem } from '@mantine/core' ;
2- import IconButton from '@/components/Button/IconButton' ;
32import { IconFilterHeart , IconMaximize , IconTable , IconTrash } from '@tabler/icons-react' ;
43import { STREAM_PRIMARY_TOOLBAR_CONTAINER_HEIGHT , STREAM_PRIMARY_TOOLBAR_HEIGHT } from '@/constants/theme' ;
5- import TimeRange from '@/components/Header/TimeRange' ;
6- import RefreshInterval from '@/components/Header/RefreshInterval' ;
7- import RefreshNow from '@/components/Header/RefreshNow' ;
8- import Querier from './Querier' ;
94import { appStoreReducers , useAppStore } from '@/layouts/MainLayout/providers/AppProvider' ;
5+ import { filterStoreReducers , useFilterStore } from '../providers/FilterProvider' ;
6+ import { logsStoreReducers , useLogsStore } from '../providers/LogsProvider' ;
107import { useCallback , useEffect } from 'react' ;
11- import StreamDropdown from '@/components/Header/StreamDropdown' ;
12- import { notifications } from '@mantine/notifications' ;
138import { useNavigate , useParams } from 'react-router-dom' ;
14- import _ from 'lodash' ;
15- import StreamingButton from '@/components/Header/StreamingButton' ;
9+
10+ import { CorrelationIcon } from '@/components/Navbar/components/CorrelationIcon' ;
11+ import IconButton from '@/components/Button/IconButton' ;
12+ import Querier from './Querier' ;
13+ import RefreshInterval from '@/components/Header/RefreshInterval' ;
14+ import RefreshNow from '@/components/Header/RefreshNow' ;
1615import ShareButton from '@/components/Header/ShareButton' ;
17- import { useLogsStore , logsStoreReducers } from '../providers/LogsProvider' ;
18- import { filterStoreReducers , useFilterStore } from '../providers/FilterProvider' ;
16+ import StreamDropdown from '@/components/Header/StreamDropdown' ;
17+ import StreamingButton from '@/components/Header/StreamingButton' ;
18+ import TimeRange from '@/components/Header/TimeRange' ;
19+ import _ from 'lodash' ;
1920import classes from './styles/PrimaryToolbar.module.css' ;
20- import { CorrelationIcon } from '@/components/Navbar/components/CorrelationIcon ' ;
21+ import { notifications } from '@mantine/notifications ' ;
2122
2223const { toggleDeleteModal, onToggleView } = logsStoreReducers ;
2324const { toggleSavedFiltersModal } = filterStoreReducers ;
25+ const { setStreamForCorrelation } = appStoreReducers ;
2426const renderMaximizeIcon = ( ) => < IconMaximize size = { px ( '1rem' ) } stroke = { 1.5 } /> ;
2527const renderDeleteIcon = ( ) => < IconTrash data-id = "delete-stream-btn" size = { px ( '1rem' ) } stroke = { 1.5 } /> ;
2628
@@ -46,12 +48,16 @@ const SavedFiltersButton = () => {
4648
4749const AddCorrelationButton = ( ) => {
4850 const navigate = useNavigate ( ) ;
51+ const [ , setAppStore ] = useAppStore ( ( ) => null ) ;
4952
5053 return (
5154 < Button
5255 className = { classes . savedFiltersBtn }
5356 h = "100%"
54- onClick = { ( ) => navigate ( '/correlation' ) }
57+ onClick = { ( ) => {
58+ setAppStore ( ( store ) => setStreamForCorrelation ( store , store . currentStream || '' ) ) ;
59+ navigate ( '/correlation' ) ;
60+ } }
5561 leftSection = { < CorrelationIcon stroke = { '#000000' } strokeWidth = { 1 } /> } >
5662 Correlate
5763 </ Button >
0 commit comments