docs: track code copy + AI assistant event (#14193)

* docs: track code copy + AI assistant event

* add pathname to callback
This commit is contained in:
Shahed Nasser authored and GitHub committed 2025-12-02 17:24:31 +02:00
1 parent ef162f8b5f
commit 00052b9e50
12 files changed
+75 -64

No files matched your search

@@ -1,24 +1,17 @@
"use client"
import {
DocsTrackingEvents,
Feedback as UiFeedback,
FeedbackProps as UiFeedbackProps,
} from "docs-ui"
import { usePathname } from "next/navigation"
import { basePathUrl } from "../../utils/base-path-url"
import { useMemo } from "react"
type FeedbackProps = Omit<UiFeedbackProps, "event" | "pathName">
const Feedback = (props: FeedbackProps) => {
const pathname = usePathname()
const feedbackPathname = useMemo(() => basePathUrl(pathname), [pathname])
return (
<UiFeedback
event="survey"
pathName={feedbackPathname}
event={DocsTrackingEvents.SURVEY}
question="Was this guide helpful?"
{...props}
/>