1
1
"use client" ;
2
2
import { useMutation } from "@tanstack/react-query" ;
3
+ import { ExternalLinkIcon } from "lucide-react" ;
4
+ import Link from "next/link" ;
3
5
import { useState } from "react" ;
4
6
import { toast } from "sonner" ;
5
7
import { createDedicatedSupportChannel } from "@/api/dedicated-support" ;
@@ -16,7 +18,7 @@ import { useDashboardRouter } from "@/lib/DashboardRouter";
16
18
17
19
const CHANNEL_TYPES = {
18
20
slack : "Slack" ,
19
- telegram : "Telegram (Coming Soon) " ,
21
+ telegram : "Telegram" ,
20
22
} as const ;
21
23
22
24
type ChannelType = keyof typeof CHANNEL_TYPES ;
@@ -57,6 +59,7 @@ export function TeamDedicatedSupportCard(props: {
57
59
58
60
const channelType = props . team . dedicatedSupportChannel ?. type ;
59
61
const channelName = props . team . dedicatedSupportChannel ?. name ;
62
+ const channelLink = props . team . dedicatedSupportChannel ?. link ;
60
63
61
64
const hasDefaultTeamName = props . team . name . startsWith ( "Your Projects" ) ;
62
65
@@ -73,11 +76,27 @@ export function TeamDedicatedSupportCard(props: {
73
76
} }
74
77
noPermissionText = { undefined }
75
78
>
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 >
81
100
</ div >
82
101
</ SettingsCard >
83
102
) ;
@@ -145,15 +164,11 @@ export function TeamDedicatedSupportCard(props: {
145
164
value = { selectedChannelType }
146
165
>
147
166
< SelectTrigger >
148
- < SelectValue placeholder = "Select Channel Type " />
167
+ < SelectValue placeholder = "Select platform " />
149
168
</ SelectTrigger >
150
169
< SelectContent >
151
170
{ 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 } >
157
172
{ name }
158
173
</ SelectItem >
159
174
) ) }
0 commit comments