diff --git a/scheduler_app/app/(routes)/[business]/[meetingEventId]/page.js b/scheduler_app/app/(routes)/[business]/[meetingEventId]/page.js new file mode 100644 index 0000000..61e5ef4 --- /dev/null +++ b/scheduler_app/app/(routes)/[business]/[meetingEventId]/page.js @@ -0,0 +1,41 @@ +"use client" +import React, { useEffect, useState } from 'react' +import MeetingEventSelection from '../_components/MeetingEventSelection' +import { collection, doc, getDoc, getDocs, getFirestore, query, where } from 'firebase/firestore' +import { app } from '@/config/FirebaseConfig' + +const ShareMeetingEvent = ({params}) => { + const [businessInfo, setBusinessInfo] = useState(); + const [meetingEventInfo, setMeetingEventInfo] = useState(); + const [loading, setLoading] = useState(false); + + const db = getFirestore(app); + + //get information + const getMeetingEventDetail = async () => { + setLoading(true) + const q = query(collection(db, 'Business'), where('businessName', '==', params.business)); + const docSnap = await getDocs(q); + docSnap.forEach((doc) => { + setBusinessInfo(doc.data()) + }); + + const docRef = doc(db, 'MeetingEvent', params.meetingEventId); + const result = await getDoc(docRef); + setMeetingEventInfo(result.data()); + setLoading(false) + } + + useEffect(() => { + params && getMeetingEventDetail(); + }, [params]) + + + return ( +
Schedule.Me
+{businessInfo?.businessName}
+Select your meeting date & time
+Availability
Available days & time
-Start time
--
-End time
- -
+
Start time
+setStartTime(e.target.value)} defaultValue={startTime}/> -
+End time
+ setEndTime(e.target.value)} defaultValue={endTime}/> +