import { ExternalLinkIcon, ExclamationIcon } from "@heroicons/react/solid"; import { useState } from "react"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import showToast from "@calcom/lib/notification"; import Button from "@calcom/ui/Button"; import classNames from "@lib/classNames"; import { trpc } from "@lib/trpc"; import ContactMenuItem from "./ContactMenuItem"; export default function HelpMenuItem() { const [rating, setRating] = useState(null); const [comment, setComment] = useState(""); // const [errorMessage, setErrorMessage] = useState(false); const [disableSubmit, setDisableSubmit] = useState(true); const { t } = useLocale(); const mutation = trpc.useMutation("viewer.submitFeedback"); const onRatingClick = (value: string) => { setRating(value); setDisableSubmit(false); }; const sendFeedback = async (rating: string, comment: string) => { mutation.mutate({ rating: rating, comment: comment }); if (mutation.isSuccess) { setDisableSubmit(true); showToast("Thank you, feedback submitted", "success"); } }; return (

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

{t("support_documentation")} {t("developer_documentation")}

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

{t("comments")}

{mutation.isError && (

{t("feedback_error")}

{t("please_try_again")}

)}
); }