langfuse
116 строк · 3.4 Кб
1import { Button } from "@/src/components/ui/button";
2import {
3Card,
4CardContent,
5CardDescription,
6CardFooter,
7CardHeader,
8CardTitle,
9} from "@/src/components/ui/card";
10import { chatAvailable, openChat } from "@/src/features/support-chat/chat";
11import {
12Book,
13Calendar,
14Github,
15Mail,
16MessageSquare,
17Slack,
18} from "lucide-react";
19import Link from "next/link";
20import { SiDiscord } from "react-icons/si";
21
22const supportChannels = [
23{
24icon: Book,
25title: "Documentation",
26description: "Find answers in the documentation.",
27href: "https://docs.langfuse.com",
28buttonText: "Visit Docs",
29primary: true,
30},
31{
32icon: Github,
33title: "GitHub",
34description:
35"Create an issue on Github to report bugs or request new features.",
36href: "https://github.com/langfuse/langfuse/issues/new/choose",
37buttonText: "Create issue",
38primary: true,
39},
40{
41icon: SiDiscord,
42title: "Discord",
43description:
44"Get support from community and maintainers. Follow announcements to stay up to date with new features.",
45href: "https://langfuse.com/discord",
46buttonText: "Join Discord",
47primary: true,
48},
49{
50icon: Mail,
51title: "Email",
52description: "Send email to our shared inbox: help@langfuse.com",
53href: "mailto:help@langfuse.com",
54buttonText: "Send Email",
55available: !chatAvailable,
56},
57{
58icon: MessageSquare,
59title: "Chat",
60description: "Get quick support directly from the team.",
61onClick: () => openChat(),
62available: chatAvailable,
63buttonText: "Launch Chat",
64},
65{
66icon: Calendar,
67title: "Schedule call",
68description: "Schedule a call with one of the founders.",
69href: "https://cal.com/marc-kl/office-hours",
70buttonText: "Schedule Call",
71},
72{
73icon: Slack,
74title: "Slack Connect",
75description: "Get a dedicated support channel for you and your team.",
76href: "mailto:help@langfuse.com?subject=Slack%20Connect%20Request&body=I'd%20like%20to%20request%20a%20dedicated%20Slack%20Connect%20channel%20for%20me%20and%20my%20team.%0D%0A%0D%0AUsers%20(emails)%20to%20include%20besides%20mine%3A%0D%0A%0D%0A",
77buttonText: "Request Slack Connect (via Email)",
78},
79];
80
81export const SupportChannels = () => (
82<div className="mt-10 grid grid-cols-1 gap-5 md:grid-cols-2 lg:grid-cols-3">
83{supportChannels
84.filter((channel) => channel.available === undefined || channel.available)
85.map((channel) => (
86<Card key={channel.title} className="flex flex-col">
87<CardHeader>
88<CardTitle className="flex items-center gap-2">
89<channel.icon size={20} />
90{channel.title}
91</CardTitle>
92</CardHeader>
93<CardContent className="flex-1">
94<CardDescription>{channel.description}</CardDescription>
95</CardContent>
96<CardFooter>
97{channel.href ? (
98<Button
99asChild
100variant={channel.primary ? "default" : "secondary"}
101>
102<Link href={channel.href}>{channel.buttonText}</Link>
103</Button>
104) : (
105<Button
106onClick={channel.onClick}
107variant={channel.primary ? "default" : "secondary"}
108>
109{channel.buttonText}
110</Button>
111)}
112</CardFooter>
113</Card>
114))}
115</div>
116);
117