11"use client" ;
22import { useMutation } from "@tanstack/react-query" ;
3+ import { ExternalLinkIcon } from "lucide-react" ;
4+ import Link from "next/link" ;
35import { useState } from "react" ;
46import { toast } from "sonner" ;
57import { createDedicatedSupportChannel } from "@/api/dedicated-support" ;
@@ -16,7 +18,7 @@ import { useDashboardRouter } from "@/lib/DashboardRouter";
1618
1719const CHANNEL_TYPES = {
1820 slack : "Slack" ,
19- telegram : "Telegram (Coming Soon) " ,
21+ telegram : "Telegram" ,
2022} as const ;
2123
2224type 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 ) ) }
0 commit comments