2023-10-19 11:52:58 +05:30
|
|
|
import './Support.styles.scss';
|
|
|
|
|
|
|
|
|
|
import { Button, Card, Typography } from 'antd';
|
2024-07-23 16:32:45 +05:30
|
|
|
import logEvent from 'api/common/logEvent';
|
2023-10-19 11:52:58 +05:30
|
|
|
import {
|
|
|
|
|
Book,
|
|
|
|
|
Cable,
|
|
|
|
|
Calendar,
|
|
|
|
|
Github,
|
|
|
|
|
MessageSquare,
|
|
|
|
|
Slack,
|
|
|
|
|
} from 'lucide-react';
|
2024-06-07 14:49:34 +05:30
|
|
|
import { useEffect } from 'react';
|
|
|
|
|
import { useHistory } from 'react-router-dom';
|
2023-10-19 11:52:58 +05:30
|
|
|
|
|
|
|
|
const { Title, Text } = Typography;
|
|
|
|
|
|
|
|
|
|
interface Channel {
|
|
|
|
|
key: any;
|
|
|
|
|
name?: string;
|
|
|
|
|
icon?: JSX.Element;
|
|
|
|
|
title?: string;
|
|
|
|
|
url: any;
|
|
|
|
|
btnText?: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const channelsMap = {
|
|
|
|
|
documentation: 'documentation',
|
|
|
|
|
github: 'github',
|
|
|
|
|
slack_community: 'slack_community',
|
|
|
|
|
chat: 'chat',
|
|
|
|
|
schedule_call: 'schedule_call',
|
|
|
|
|
slack_connect: 'slack_connect',
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const supportChannels = [
|
|
|
|
|
{
|
|
|
|
|
key: 'documentation',
|
|
|
|
|
name: 'Documentation',
|
|
|
|
|
icon: <Book />,
|
|
|
|
|
title: 'Find answers in the documentation.',
|
|
|
|
|
url: 'https://signoz.io/docs/',
|
|
|
|
|
btnText: 'Visit docs',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'github',
|
|
|
|
|
name: 'Github',
|
|
|
|
|
icon: <Github />,
|
|
|
|
|
title: 'Create an issue on GitHub to report bugs or request new features.',
|
|
|
|
|
url: 'https://github.com/SigNoz/signoz/issues',
|
|
|
|
|
btnText: 'Create issue',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'slack_community',
|
|
|
|
|
name: 'Slack Community',
|
|
|
|
|
icon: <Slack />,
|
|
|
|
|
title: 'Get support from the SigNoz community on Slack.',
|
|
|
|
|
url: 'https://signoz.io/slack',
|
|
|
|
|
btnText: 'Join Slack',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'chat',
|
|
|
|
|
name: 'Chat',
|
|
|
|
|
icon: <MessageSquare />,
|
|
|
|
|
title: 'Get quick support directly from the team.',
|
|
|
|
|
url: '',
|
|
|
|
|
btnText: 'Launch chat',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'schedule_call',
|
|
|
|
|
name: 'Schedule a call',
|
|
|
|
|
icon: <Calendar />,
|
|
|
|
|
title: 'Schedule a call with the founders.',
|
|
|
|
|
url: 'https://calendly.com/pranay-signoz/signoz-intro-calls',
|
|
|
|
|
btnText: 'Schedule call',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'slack_connect',
|
|
|
|
|
name: 'Slack Connect',
|
|
|
|
|
icon: <Cable />,
|
|
|
|
|
title: 'Get a dedicated support channel for your team.',
|
|
|
|
|
url: '',
|
|
|
|
|
btnText: 'Request Slack connect',
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
export default function Support(): JSX.Element {
|
2024-06-07 14:49:34 +05:30
|
|
|
const history = useHistory();
|
2023-12-13 01:18:19 +05:30
|
|
|
|
2023-10-19 11:52:58 +05:30
|
|
|
const handleChannelWithRedirects = (url: string): void => {
|
|
|
|
|
window.open(url, '_blank');
|
|
|
|
|
};
|
|
|
|
|
|
2024-06-07 14:49:34 +05:30
|
|
|
useEffect(() => {
|
|
|
|
|
if (history?.location?.state) {
|
|
|
|
|
const histroyState = history?.location?.state as any;
|
|
|
|
|
|
|
|
|
|
if (histroyState && histroyState?.from) {
|
2024-07-23 16:32:45 +05:30
|
|
|
logEvent(`Support : From URL : ${histroyState.from}`, {});
|
2024-06-07 14:49:34 +05:30
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
|
|
|
}, []);
|
|
|
|
|
|
2023-10-19 11:52:58 +05:30
|
|
|
const handleSlackConnectRequest = (): void => {
|
|
|
|
|
const recipient = 'support@signoz.io';
|
|
|
|
|
const subject = 'Slack Connect Request';
|
|
|
|
|
const body = `I'd like to request a dedicated Slack Connect channel for me and my team. Users (emails) to include besides mine:`;
|
|
|
|
|
|
|
|
|
|
// Create the mailto link
|
|
|
|
|
const mailtoLink = `mailto:${recipient}?subject=${encodeURIComponent(
|
|
|
|
|
subject,
|
|
|
|
|
)}&body=${encodeURIComponent(body)}`;
|
|
|
|
|
|
|
|
|
|
// Open the default email client
|
|
|
|
|
window.location.href = mailtoLink;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleChat = (): void => {
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
if (window.Intercom) {
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
window.Intercom('show');
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleChannelClick = (channel: Channel): void => {
|
2024-07-23 16:32:45 +05:30
|
|
|
logEvent(`Support : ${channel.name}`, {});
|
2023-12-13 01:18:19 +05:30
|
|
|
|
2023-10-19 11:52:58 +05:30
|
|
|
switch (channel.key) {
|
|
|
|
|
case channelsMap.documentation:
|
|
|
|
|
case channelsMap.github:
|
|
|
|
|
case channelsMap.slack_community:
|
|
|
|
|
case channelsMap.schedule_call:
|
|
|
|
|
handleChannelWithRedirects(channel.url);
|
|
|
|
|
break;
|
|
|
|
|
case channelsMap.chat:
|
|
|
|
|
handleChat();
|
|
|
|
|
break;
|
|
|
|
|
case channelsMap.slack_connect:
|
|
|
|
|
handleSlackConnectRequest();
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
handleChannelWithRedirects('https://signoz.io/slack');
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="support-page-container">
|
|
|
|
|
<div className="support-page-header">
|
|
|
|
|
<Title level={3}> Support </Title>
|
|
|
|
|
<Text style={{ fontSize: 14 }}>
|
|
|
|
|
We are here to help in case of questions or issues. Pick the channel that
|
|
|
|
|
is most convenient for you.
|
|
|
|
|
</Text>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="support-channels">
|
|
|
|
|
{supportChannels.map(
|
|
|
|
|
(channel): JSX.Element => (
|
|
|
|
|
<Card className="support-channel" key={channel.key}>
|
|
|
|
|
<div className="support-channel-content">
|
|
|
|
|
<Title ellipsis level={5} className="support-channel-title">
|
|
|
|
|
{channel.icon}
|
|
|
|
|
{channel.name}{' '}
|
|
|
|
|
</Title>
|
|
|
|
|
<Text> {channel.title} </Text>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="support-channel-action">
|
|
|
|
|
<Button
|
|
|
|
|
type="default"
|
|
|
|
|
onClick={(): void => handleChannelClick(channel)}
|
|
|
|
|
>
|
|
|
|
|
<Text ellipsis>{channel.btnText} </Text>
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</Card>
|
|
|
|
|
),
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|