Files
medusa-store/www/apps/ui/src/components/feedback.tsx
Shahed Nasser 987dd8f568 docs: expanded rating form + UI docs improvement (#5211)
* docs: expanded rating form + UI docs improvement

* added props table + changed example
2023-09-26 20:26:09 +03:00

32 lines
712 B
TypeScript

"use client"
import {
Feedback as UiFeedback,
FeedbackProps as UiFeedbackProps,
formatReportLink,
} from "docs-ui"
import { usePathname } from "next/navigation"
import { absoluteUrl } from "@/lib/absolute-url"
import clsx from "clsx"
export type FeedbackProps = {
title: string
} & Partial<UiFeedbackProps>
export const Feedback = ({ title, ...props }: FeedbackProps) => {
const pathname = usePathname()
return (
<UiFeedback
event="survey"
pathName={absoluteUrl(pathname)}
reportLink={formatReportLink("UI Docs", title, "ui")}
extraData={{
section: title,
}}
{...props}
className={clsx("text-medusa-fg-subtle", props.className)}
/>
)
}