1- import React from "react" ;
2- import { View , ScrollView } from "react-native" ;
3- import DoctorVideo from "@/components/cards/DoctorVideo" ;
4- import { useRouter } from "expo-router" ;
5- import { DoctorCard } from "./types" ; // Import the types
1+ // import React, {useState, useEffect} from "react";
2+ // import { View, ScrollView } from "react-native";
3+ // import DoctorVideo from "@/components/cards/DoctorVideo";
4+ // import { useRouter } from "expo-router";
5+ // import { DoctorCard } from "./types";
6+ // import { supabase } from "../supabase";
7+ // const VideoCall = () => {
8+ // const router = useRouter();
9+ // const [appointment, setAppointment]=useState<any[]>([]);
610
7- const VideoCall = ( ) => {
8- const router = useRouter ( ) ;
11+ // useEffect(()=>{
12+ // const fetchAppointments=async()=>{
13+ // const {data, error}=await supabase.auth.getUser();
14+ // if(error) throw error;
15+ // const userId=data?.user?.id;
16+ // const {data:AppointmentData, error:Error}=await supabase.from("appointment").select("*, doctor(name,image)").eq("patient_id", userId).eq("package","Video Call")
17+ // if(Error) throw Error
18+ // if(AppointmentData){
19+ // setAppointment(AppointmentData);
20+ // }
21+ // }
22+ // fetchAppointments();
23+ // },[])
24+
25+ // const handlePress = (appointmentId:any) => {
26+ // router.push({
27+ // pathname: "/chat-history/VideoRecord",
28+ // params: {appointmentId},
29+ // });
30+ // };
31+ // return (
32+ // <View style={{ backgroundColor: "white" }}>
33+ // <ScrollView style={{ backgroundColor: "#FAFAFA", paddingBottom: 6 }}>
34+ // {appointment.map((appointments, index) => (
35+ // <DoctorVideo
36+ // key={index}
37+ // onPress={() => handlePress(appointments.id)}
38+ // doctorName={appointments.doctor.name}
39+ // doctorImage={appointments.doctor.image}
40+ // callType={appointments.package}
41+ // callDay={appointments.appointment_date}
42+ // callTime={appointments.appointment_time.slice(0,5)}
43+ // isVideoCallScreen={false}
44+ // />
45+ // ))}
46+ // </ScrollView>
47+ // </View>
48+ // );
49+ // };
950
10- const docCards : DoctorCard [ ] = [
11- {
12- name : "Dr. Randy Wigham" ,
13- callDay : "Wednesday" ,
14- callTime : "1:00 PM" ,
15- images : require ( "../../assets/doctors/doc2.png" ) ,
16- } ,
17- {
18- name : "Dr. Jenny Watson" ,
19- callDay : "Wednesday" ,
20- callTime : "1:00 PM" ,
21- images : require ( "../../assets/doctors/doc3.png" ) ,
22- } ,
23- {
24- name : "Dr. Raul Zirkind" ,
25- callDay : "Wednesday" ,
26- callTime : "1:00 PM" ,
27- images : require ( "../../assets/doctors/doc1.png" ) ,
28- } ,
29- {
30- name : "Dr. Elijah Baranick" ,
31- callDay : "Wednesday" ,
32- callTime : "1:00 PM" ,
33- images : require ( "../../assets/doctors/doc2.png" ) ,
34- } ,
35- {
36- name : "Dr. Stephen Shute" ,
37- callDay : "Wednesday" ,
38- callTime : "1:00 PM" ,
39- images : require ( "../../assets/doctors/doc5.png" ) ,
40- } ,
41- ] ;
42-
43- const handlePress = ( doctor : DoctorCard ) => {
44- router . push ( {
45- pathname : "/chat-history/VideoRecord" ,
46- params : { doctor : JSON . stringify ( doctor ) } ,
47- } ) ;
48- } ;
49-
50- return (
51- < View style = { { backgroundColor : "white" } } >
52- < ScrollView style = { { backgroundColor : "#FAFAFA" , paddingBottom : 6 } } >
53- { docCards . map ( ( doctor , index ) => (
54- < DoctorVideo
55- key = { index }
56- onPress = { ( ) => handlePress ( doctor ) }
57- doctorName = { doctor . name }
58- doctorImage = { doctor . images }
59- callType = "Video Call"
60- callDay = { doctor . callDay }
61- callTime = { doctor . callTime }
62- isVideoCallScreen = { false }
63- />
64- ) ) }
65- </ ScrollView >
66- </ View >
67- ) ;
68- } ;
69-
70- export default VideoCall ;
51+ // export default VideoCall;
0 commit comments