import { useState } from "react"; import { useChat } from "react-live-chat-loader"; import classNames from "@calcom/lib/classNames"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import showToast from "@calcom/lib/notification"; import { trpc } from "@calcom/trpc/react"; import Button from "@calcom/ui/Button"; import { Icon } from "@calcom/ui/Icon"; import ContactMenuItem from "./ContactMenuItem"; interface HelpMenuItemProps { onHelpItemSelect: () => void; } export default function HelpMenuItem({ onHelpItemSelect }: HelpMenuItemProps) { const [rating, setRating] = useState(null); const [comment, setComment] = useState(""); const [disableSubmit, setDisableSubmit] = useState(true); const [active, setActive] = useState(false); const [, loadChat] = useChat(); const { t } = useLocale(); const mutation = trpc.useMutation("viewer.submitFeedback", { onSuccess: () => { setDisableSubmit(true); showToast("Thank you, feedback submitted", "success"); onHelpItemSelect(); }, }); const onRatingClick = (value: string) => { setRating(value); setDisableSubmit(false); }; const sendFeedback = async (rating: string, comment: string) => { mutation.mutate({ rating: rating, comment: comment }); }; return (

{t("resources").toUpperCase()}

onHelpItemSelect()} href="https://docs.cal.com/" target="_blank" className="flex w-full px-5 py-2 pr-4 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-gray-900" rel="noreferrer"> {t("support_documentation")} onHelpItemSelect()} href="https://developer.cal.com/" target="_blank" className="flex w-full px-5 py-2 pr-4 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-gray-900" rel="noreferrer"> {t("developer_documentation")}
onHelpItemSelect()}>

{t("feedback").toUpperCase()}

{t("comments")}