* Icon and IconName * Button and ButtonGroup * UserAvatar * AvatarGroup * Avatar * WizardLayout * Dialogs * EmptyScreen * showToast and TextField * Editor * Skeleton * Skeleton * TopBanner and showToast * Button again * more * perf: Remove app-store reference from @calcom/ui * more * Fixing types * Icon * Fixed casing * dropdown * more * Select * more * Badge * List * more * Divider * more * fix * fix type check * refactor * fix * fix * fix * fix * fix * fix * fix * fix type check * fix * fix * fix * fix * more * more * more * more * add index file to components/command * fix * fix * fix * fix imports * fix * fix * fix * fix * fix * fix * fix * fix build errors * fix build errors * fix --------- Co-authored-by: Keith Williams <keithwillcode@gmail.com>
46 lines
1.6 KiB
TypeScript
46 lines
1.6 KiB
TypeScript
import { JOIN_COMMUNITY } from "@calcom/lib/constants";
|
|
import { useHasPaidPlan } from "@calcom/lib/hooks/useHasPaidPlan";
|
|
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
|
import { UpgradeTeamsBadge } from "@calcom/ui/components/badge";
|
|
import { Icon } from "@calcom/ui/components/icon";
|
|
|
|
import FreshChatMenuItem from "../lib/freshchat/FreshChatMenuItem";
|
|
import HelpscoutMenuItem from "../lib/helpscout/HelpscoutMenuItem";
|
|
import ZendeskMenuItem from "../lib/zendesk/ZendeskMenuItem";
|
|
|
|
interface ContactMenuItem {
|
|
onHelpItemSelect: () => void;
|
|
}
|
|
|
|
export default function ContactMenuItem(props: ContactMenuItem) {
|
|
const { t } = useLocale();
|
|
const { onHelpItemSelect } = props;
|
|
const { hasPaidPlan } = useHasPaidPlan();
|
|
return (
|
|
<>
|
|
{hasPaidPlan ? (
|
|
<>
|
|
<ZendeskMenuItem onHelpItemSelect={onHelpItemSelect} />
|
|
<HelpscoutMenuItem onHelpItemSelect={onHelpItemSelect} />
|
|
<FreshChatMenuItem onHelpItemSelect={onHelpItemSelect} />
|
|
</>
|
|
) : (
|
|
<div className=" hover:text-emphasis text-default flex w-full cursor-not-allowed justify-between px-5 py-2 pr-4 text-sm font-medium">
|
|
{t("premium_support")}
|
|
<UpgradeTeamsBadge />
|
|
</div>
|
|
)}
|
|
<a
|
|
href={JOIN_COMMUNITY}
|
|
target="_blank"
|
|
className="hover:bg-subtle hover:text-emphasis text-default flex w-full px-5 py-2 pr-4 text-sm font-medium transition">
|
|
{t("community_support")}{" "}
|
|
<Icon
|
|
name="external-link"
|
|
className="group-hover:text-subtle text-muted ml-1 mt-px h-4 w-4 flex-shrink-0 ltr:mr-3"
|
|
/>
|
|
</a>
|
|
</>
|
|
);
|
|
}
|