1- import * as Clipboard from "expo-clipboard" ;
21import { Ionicons } from "@expo/vector-icons" ;
2+ import * as Clipboard from "expo-clipboard" ;
33import { Stack , useLocalSearchParams , useNavigation , useRouter } from "expo-router" ;
44import { useCallback , useEffect , useMemo , useRef } from "react" ;
5- import { Platform , Text , View , useColorScheme } from "react-native" ;
5+ import { Platform , Text , useColorScheme , View } from "react-native" ;
66import { AppPressable } from "@/components/AppPressable" ;
77import { HeaderButtonWrapper } from "@/components/HeaderButtonWrapper" ;
88import { BookingDetailScreen } from "@/components/screens/BookingDetailScreen" ;
@@ -16,10 +16,10 @@ import {
1616} from "@/components/ui/dropdown-menu" ;
1717import { useAuth } from "@/contexts/AuthContext" ;
1818import { useBookingByUid } from "@/hooks/useBookings" ;
19- import type { Booking } from "@/services/calcom" ;
2019import { showErrorAlert , showInfoAlert , showSuccessAlert } from "@/utils/alerts" ;
2120import { type BookingActionsResult , getBookingActions } from "@/utils/booking-actions" ;
22- import { openInAppBrowser } from "@/utils/browser" ;
21+ import { getMeetingUrl } from "@/utils/booking" ;
22+ import { openInDefaultBrowser } from "@/utils/browser" ;
2323
2424// Empty actions result for when no booking is loaded
2525const EMPTY_ACTIONS : BookingActionsResult = {
@@ -33,22 +33,6 @@ const EMPTY_ACTIONS: BookingActionsResult = {
3333 markNoShow : { visible : false , enabled : false } ,
3434} ;
3535
36- const getMeetingUrl = ( booking : Booking | null ) : string | null => {
37- if ( ! booking ) return null ;
38-
39- const videoCallUrl = booking . responses ?. videoCallUrl ;
40- if ( typeof videoCallUrl === "string" && videoCallUrl . startsWith ( "http" ) ) {
41- return videoCallUrl ;
42- }
43-
44- const location = booking . location ;
45- if ( typeof location === "string" && location . startsWith ( "http" ) ) {
46- return location ;
47- }
48-
49- return null ;
50- } ;
51-
5236// Type for action handlers exposed by BookingDetailScreen
5337type ActionHandlers = {
5438 openRescheduleModal : ( ) => void ;
@@ -280,7 +264,7 @@ export default function BookingDetail() {
280264
281265 const handleJoinMeeting = useCallback ( ( ) => {
282266 if ( meetingUrl ) {
283- openInAppBrowser ( meetingUrl , "meeting link" ) ;
267+ openInDefaultBrowser ( meetingUrl , "meeting link" ) ;
284268 }
285269 } , [ meetingUrl ] ) ;
286270
0 commit comments