File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/frontend/apps/impress/src/features/left-panel/components Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -8,12 +8,14 @@ import { useCreateDoc } from '@/docs/doc-management';
88import { DocSearchModal } from '@/docs/doc-search' ;
99import { useAuth } from '@/features/auth' ;
1010import { useCmdK } from '@/hook/useCmdK' ;
11+ import { useAnalytics } from '@/libs' ;
1112
1213import { useLeftPanelStore } from '../stores' ;
1314
1415export const LeftPanelHeader = ( { children } : PropsWithChildren ) => {
1516 const router = useRouter ( ) ;
1617 const { authenticated } = useAuth ( ) ;
18+ const { trackEvent } = useAnalytics ( ) ;
1719 const [ isSearchModalOpen , setIsSearchModalOpen ] = useState ( false ) ;
1820
1921 const openSearchModal = useCallback ( ( ) => {
@@ -23,8 +25,10 @@ export const LeftPanelHeader = ({ children }: PropsWithChildren) => {
2325 return ;
2426 }
2527
28+ trackEvent ( { eventName : 'openSearchModal' , position : 'LeftPanelHeader' } ) ;
29+
2630 setIsSearchModalOpen ( true ) ;
27- } , [ ] ) ;
31+ } , [ trackEvent ] ) ;
2832
2933 const closeSearchModal = useCallback ( ( ) => {
3034 setIsSearchModalOpen ( false ) ;
@@ -46,6 +50,7 @@ export const LeftPanelHeader = ({ children }: PropsWithChildren) => {
4650 } ;
4751
4852 const createNewDoc = ( ) => {
53+ trackEvent ( { eventName : 'createNewDoc' , position : 'LeftPanelHeader' } ) ;
4954 createDoc ( ) ;
5055 } ;
5156
You can’t perform that action at this time.
0 commit comments