(activeTab: string)
| 2 | import { useAnalytics } from './useAnalytics' |
| 3 | |
| 4 | export const useTabTracking = (activeTab: string) => { |
| 5 | const analytics = useAnalytics() |
| 6 | const previousTabRef = useRef<string>('') |
| 7 | |
| 8 | useEffect(() => { |
| 9 | if (previousTabRef.current && previousTabRef.current !== activeTab) { |
| 10 | analytics.trackTabChange(previousTabRef.current, activeTab) |
| 11 | } |
| 12 | previousTabRef.current = activeTab |
| 13 | }, [activeTab, analytics]) |
| 14 | } |
no test coverage detected