Skip to content

Commit d0fa1b1

Browse files
authored
chore: Enable telegram support channel, add join link button (#7472)
1 parent 85a5037 commit d0fa1b1

File tree

2 files changed

+28
-12
lines changed
  • apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/settings/_components/settings-cards
  • packages/service-utils/src/core

2 files changed

+28
-12
lines changed

apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/settings/_components/settings-cards/dedicated-support.tsx

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"use client";
22
import { useMutation } from "@tanstack/react-query";
3+
import { ExternalLinkIcon } from "lucide-react";
4+
import Link from "next/link";
35
import { useState } from "react";
46
import { toast } from "sonner";
57
import { createDedicatedSupportChannel } from "@/api/dedicated-support";
@@ -16,7 +18,7 @@ import { useDashboardRouter } from "@/lib/DashboardRouter";
1618

1719
const CHANNEL_TYPES = {
1820
slack: "Slack",
19-
telegram: "Telegram (Coming Soon)",
21+
telegram: "Telegram",
2022
} as const;
2123

2224
type ChannelType = keyof typeof CHANNEL_TYPES;
@@ -57,6 +59,7 @@ export function TeamDedicatedSupportCard(props: {
5759

5860
const channelType = props.team.dedicatedSupportChannel?.type;
5961
const channelName = props.team.dedicatedSupportChannel?.name;
62+
const channelLink = props.team.dedicatedSupportChannel?.link;
6063

6164
const hasDefaultTeamName = props.team.name.startsWith("Your Projects");
6265

@@ -73,11 +76,27 @@ export function TeamDedicatedSupportCard(props: {
7376
}}
7477
noPermissionText={undefined}
7578
>
76-
<div className="md:w-[450px]">
77-
<p className="text-muted-foreground text-sm">
78-
Your dedicated support channel: #<strong>{channelName}</strong>{" "}
79-
{CHANNEL_TYPES[channelType]}
80-
</p>
79+
<div className="space-y-3">
80+
<div className="rounded-lg border bg-muted/50 p-4">
81+
<div className="flex items-center justify-between">
82+
<div>
83+
<p className="font-bold">{channelName}</p>
84+
<p className="text-muted-foreground text-sm">
85+
{CHANNEL_TYPES[channelType]} channel
86+
</p>
87+
</div>
88+
{channelType === "telegram" && channelLink && (
89+
<Link
90+
className="inline-flex items-center gap-2 rounded-md border border-input px-3 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground transition-colors"
91+
href={channelLink}
92+
target="_blank"
93+
>
94+
Join channel
95+
<ExternalLinkIcon className="size-4" />
96+
</Link>
97+
)}
98+
</div>
99+
</div>
81100
</div>
82101
</SettingsCard>
83102
);
@@ -145,15 +164,11 @@ export function TeamDedicatedSupportCard(props: {
145164
value={selectedChannelType}
146165
>
147166
<SelectTrigger>
148-
<SelectValue placeholder="Select Channel Type" />
167+
<SelectValue placeholder="Select platform" />
149168
</SelectTrigger>
150169
<SelectContent>
151170
{Object.entries(CHANNEL_TYPES).map(([value, name]) => (
152-
<SelectItem
153-
disabled={value === "telegram"}
154-
key={value}
155-
value={value}
156-
>
171+
<SelectItem key={value} value={value}>
157172
{name}
158173
</SelectItem>
159174
))}

packages/service-utils/src/core/api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ export type TeamResponse = {
150150
dedicatedSupportChannel: {
151151
type: "slack" | "telegram";
152152
name: string;
153+
link: string | null;
153154
} | null;
154155
};
155156

0 commit comments

Comments
 (0)