mirror of
https://github.com/supabase/supabase.git
synced 2026-10-16 22:59:11 +03:00
20 lines
459 B
TypeScript
20 lines
459 B
TypeScript
'use client'
|
|
|
|
import { usePathname } from 'next/navigation'
|
|
import { useCallback } from 'react'
|
|
|
|
import { sendTelemetryEvent } from 'common'
|
|
import { TelemetryEvent } from 'common/telemetry-constants'
|
|
import { API_URL } from 'lib/constants'
|
|
|
|
export function useSendTelemetryEvent() {
|
|
const pathname = usePathname()
|
|
|
|
return useCallback(
|
|
(event: TelemetryEvent) => {
|
|
return sendTelemetryEvent(API_URL, event, pathname)
|
|
},
|
|
[pathname]
|
|
)
|
|
}
|