33import { useRouter } from "next/navigation" ;
44import { useEffect , useState } from "react" ;
55
6+ import { isRedirectApp } from "@calcom/app-store/_utils/redirectApps" ;
67import useAddAppMutation from "@calcom/app-store/_utils/useAddAppMutation" ;
78import { InstallAppButton } from "@calcom/app-store/components" ;
89import { doesAppSupportTeamInstall , isConferencing } from "@calcom/app-store/utils" ;
@@ -56,6 +57,10 @@ export function AppCard({ app, credentials, searchText, userAdminTeams }: AppCar
5657 } , [ app . name , searchText ] ) ;
5758
5859 const handleAppInstall = ( ) => {
60+ if ( isRedirectApp ( app . slug ) ) {
61+ mutation . mutate ( { type : app . type , variant : app . variant , slug : app . slug } ) ;
62+ return ;
63+ }
5964 if ( isConferencing ( app . categories ) && ! app . concurrentMeetings ) {
6065 mutation . mutate ( {
6166 type : app . type ,
@@ -148,7 +153,9 @@ export function AppCard({ app, credentials, searchText, userAdminTeams }: AppCar
148153 loading : mutation . isPending ,
149154 } ;
150155 }
151- return < InstallAppButtonChild paid = { app . paid } { ...props } /> ;
156+ return (
157+ < InstallAppButtonChild paid = { app . paid } isRedirect = { isRedirectApp ( app . slug ) } { ...props } />
158+ ) ;
152159 } }
153160 />
154161 )
@@ -170,7 +177,9 @@ export function AppCard({ app, credentials, searchText, userAdminTeams }: AppCar
170177 loading : mutation . isPending ,
171178 } ;
172179 }
173- return < InstallAppButtonChild paid = { app . paid } { ...props } /> ;
180+ return (
181+ < InstallAppButtonChild paid = { app . paid } isRedirect = { isRedirectApp ( app . slug ) } { ...props } />
182+ ) ;
174183 } }
175184 />
176185 ) }
@@ -192,11 +201,25 @@ export function AppCard({ app, credentials, searchText, userAdminTeams }: AppCar
192201
193202const InstallAppButtonChild = ( {
194203 paid,
204+ isRedirect = false ,
195205 ...props
196206} : {
197207 paid : App [ "paid" ] ;
208+ isRedirect ?: boolean ;
198209} & ButtonProps ) => {
199210 const { t } = useLocale ( ) ;
211+ if ( isRedirect ) {
212+ return (
213+ < Button
214+ color = "secondary"
215+ className = "[@media(max-width:260px)]:w-full [@media(max-width:260px)]:justify-center"
216+ StartIcon = "external-link"
217+ { ...props }
218+ size = "base" >
219+ { t ( "visit" ) }
220+ </ Button >
221+ ) ;
222+ }
200223 // Paid apps don't support team installs at the moment
201224 // Also, cal.ai(the only paid app at the moment) doesn't support team install either
202225 if ( paid ) {
0 commit comments