| 3 | import { op } from '@/utils/op'; |
| 4 | |
| 5 | export function FeedbackButton({ className }: { className?: string }) { |
| 6 | const context = useRouteContext({ strict: false }); |
| 7 | return ( |
| 8 | <button |
| 9 | className={cn('justify-start text-left text-[13px]', className)} |
| 10 | onClick={() => { |
| 11 | op.track('feedback_button_clicked'); |
| 12 | if ('uj' in window && window.uj !== undefined) { |
| 13 | (window as any).uj.identify({ |
| 14 | id: context.session?.userId, |
| 15 | firstName: context.session?.user?.firstName, |
| 16 | email: context.session?.user?.email, |
| 17 | }); |
| 18 | setTimeout(() => { |
| 19 | (window as any).uj.showWidget(); |
| 20 | }, 10); |
| 21 | } |
| 22 | }} |
| 23 | type="button" |
| 24 | > |
| 25 | Give feedback |
| 26 | </button> |
| 27 | ); |
| 28 | } |