mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 09:55:06 +03:00
* chore: add usercentrics for consent management * client component to make next.js happy * address feedback * move consent state to common * fix import * ensure page events are sent correctly * add feature flag provider to ui library site * fix ui lib 500 error * skip in test env --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com> Co-authored-by: Jordi Enric <jordi.err@gmail.com>
23 lines
767 B
TypeScript
23 lines
767 B
TypeScript
import { PageTelemetry } from 'common'
|
|
import GroupsTelemetry from 'components/ui/GroupsTelemetry'
|
|
import { API_URL, IS_PLATFORM } from 'lib/constants'
|
|
import { useConsentToast } from 'ui-patterns/consent'
|
|
|
|
export function Telemetry() {
|
|
// Although this is "technically" breaking the rules of hooks
|
|
// IS_PLATFORM never changes within a session, so this won't cause any issues
|
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
const { hasAcceptedConsent } = IS_PLATFORM ? useConsentToast() : { hasAcceptedConsent: true }
|
|
|
|
return (
|
|
<>
|
|
<PageTelemetry
|
|
API_URL={API_URL}
|
|
hasAcceptedConsent={hasAcceptedConsent}
|
|
enabled={IS_PLATFORM}
|
|
/>
|
|
<GroupsTelemetry hasAcceptedConsent={hasAcceptedConsent} />
|
|
</>
|
|
)
|
|
}
|