import { useMemo } from "react"; import { Button } from "@/src/components/ui/button"; import { Github, Bug, Lightbulb, Sparkles, LibraryBig, LifeBuoy, Radio, Calendar, } from "lucide-react"; //eslint-disable-next-line no-restricted-imports import { SiDiscord } from "react-icons/si"; import { RainbowButton } from "@/src/components/magicui/rainbow-button"; import { Separator } from "@/src/components/ui/separator"; import { usePlan } from "@/src/features/entitlements/hooks"; import { isCloudPlan } from "@langfuse/shared"; import { useUiCustomization } from "@/src/ee/features/ui-customization/useUiCustomization"; import { useLangfuseCloudRegion } from "@/src/features/organizations/hooks"; import { usePostHogClientCapture } from "@/src/features/posthog-analytics/usePostHogClientCapture"; type SupportType = "in-app-support" | "custom" | "community"; export function IntroSection({ onStartForm, }: { onStartForm: () => void; displayDensity?: "default" | "compact"; }) { const uiCustomization = useUiCustomization(); const { isLangfuseCloud } = useLangfuseCloudRegion(); const capture = usePostHogClientCapture(); // Note: We previously added an entitlement for in-app support, but removed it for now. // The issue was that on global routes e.g., https://langfuse.com/setup, the entitlement // hook would not have access to an org or project an therefore no plan, always returning // false if asked. However on these pages, the in-app-chat should be available. // Therefore we now check for whether wer are in a cloud deployment instead. // const hasInAppSupportEntitlement = useHasEntitlement("in-app-support"); const hasInAppSupportEntitlement = !!isLangfuseCloud; const plan = usePlan(); const supportType: SupportType = useMemo(() => { if (uiCustomization?.supportHref) { return "custom"; } if (hasInAppSupportEntitlement) { return "in-app-support"; } return "community"; }, [hasInAppSupportEntitlement, uiCustomization]); const showStatusPageLink = useMemo(() => { return isCloudPlan(plan); }, [plan]); return (
Ask AI

Get instant, helpful answers. Our AI knows the docs, examples, and best practices to guide you fast.

Chat with AI
Docs

Dive into guides, concepts, and API reference — clear steps and examples to move quickly.

{supportType === "custom" && ( <>
Support

Ask AI & Docs did not unblock you? Get in touch with the support team.

{uiCustomization?.feedbackHref && ( )} {!uiCustomization?.supportHref && ( <> )}
)} {supportType === "in-app-support" && ( <>
Email a Support Engineer

Ask AI & Docs did not unblock you? One of our support engineers will help you get unblocked.

)} {supportType === "community" && ( <>
Community Support

Ask AI & Docs did not unblock you? Get help from and share feedback with the community.

)} {supportType !== "custom" && (
Community & Resources

Join the conversation and connect with the Langfuse community.

)}
); }